diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs index 13796fab64639cc6fcd5d322ec29e8f7bade7dd3..52fc758af8adc932a820fae97052468f838100c1 100644 --- a/examples/rtt_timing.rs +++ b/examples/rtt_timing.rs @@ -1,6 +1,6 @@ //! examples/rtt_timing.rs -#![deny(unsafe_code)] +// #![deny(unsafe_code)] #![deny(warnings)] #![no_main] #![no_std] @@ -22,6 +22,9 @@ const APP: () = { cx.core.DWT.enable_cycle_counter(); rprintln!("start timed_loop"); + unsafe { + cx.core.DWT.cyccnt.write(0); + } let (start, end) = timed_loop(); rprintln!( "start {}, end {}, diff {}", @@ -348,9 +351,10 @@ fn timed_loop() -> (u32, u32) { // (when hitting the `timed_loop` breakpoint)? // // [Your answer here] +// 0x00000009 // // ------------------------------------------------------------------------ -// F) Finally some statics +// G) Finally some statics // For embedded it is often/typically crucial to reduce overhead, // - code footprint (flash memory) // - memory footprint (sram memory)