Skip to content
Snippets Groups Projects
Commit 33bb1704 authored by Carl Österberg's avatar Carl Österberg
Browse files

Feedback fixes

parent 50bc2181
No related branches found
No related tags found
No related merge requests found
......@@ -22,9 +22,8 @@ const APP: () = {
loop {
//cortex_m::asm::bkpt();
//x = x.wrapping_add(1);
//cortex_m::asm::bkpt();
x+=1;
//cortex_m::asm::bkpt();
// prevent optimization by read-volatile (unsafe)
// unsafe {
// core::ptr::read_volatile(&x);
......@@ -67,9 +66,12 @@ const APP: () = {
// > backtrace
//
// Paste the backtrace:
// #0 rtic_bare1::init (_cx=...) at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:29
// #1 0x08000f08 in rtic_bare1::APP::main () at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:15
// {"token":59,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
// #0 rust_begin_unwind (info=0x2000fee0) at /home/carlosterberg/.cargo/registry/src/github.com-1ecc6299db9ec823/panic-semihosting-0.5.6/src/lib.rs:95
// #1 0x0800039a in core::panicking::panic_fmt () at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b//library/core/src/panicking.rs:92
// #2 0x08000374 in core::panicking::panic () at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b//library/core/src/panicking.rs:50
// #3 0x08000eac in rtic_bare1::init (_cx=...) at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:25
// #4 0x08000ef6 in rtic_bare1::APP::main () at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:15
// {"token":58,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
//
//
// Explain in your own words the chain of calls.
......
......@@ -23,14 +23,15 @@ const APP: () = {
let start = Instant::now();
wait(1_000_000);
let end = Instant::now();
//let end = Instant::now();
let end = start.elapsed();
// notice all printing outside of the section to measure!
hprintln!("Start {:?}", start).ok();
hprintln!("End {:?}", end).ok();
//hprintln!("End {:?}", end).ok();
//hprintln!("Diff {:?}", (end - start).as_cycles()).ok();
//hprintln!("Diff {:?}", end.duration_since(start).as_cycles()).ok();
hprintln!("Diff {:?}", (start.elapsed() - end.elapsed()).as_cycles()).ok();
hprintln!("Diff {:?}", end.as_cycles()).ok();
}
};
......@@ -102,9 +103,8 @@ fn wait(i: u32) {
//
// What is now the output in the Adapter Output console?
//
// Start Instant(1175751045)
// End Instant(1179751061)
// Diff 4000009
// Start Instant(1072806007)
// Diff 4000016
//
// Commit your answers (bare3_3)
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment