diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs index fb6ddfb02da428add9ee1b6dd5d9b2a572fe6f68..96bf43a608a070dde3ba04d5b8afa501bd2bf2e5 100644 --- a/examples/rtt_timing.rs +++ b/examples/rtt_timing.rs @@ -6,37 +6,25 @@ #![no_std] use cortex_m::{asm, peripheral::DWT}; -use panic_rtt_target as _; -use rtt_target::{rprintln, rtt_init_print}; +use panic_halt as _; use stm32f4; #[rtic::app(device = stm32f4)] const APP: () = { #[init] fn init(mut cx: init::Context) { - rtt_init_print!(); - rprintln!("init"); - // Initialize (enable) the monotonic timer (CYCCNT) cx.core.DCB.enable_trace(); 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 {}", - start, - end, - end.wrapping_sub(start) - ); + let (_start, _end) = timed_loop(); } #[idle] fn idle(_cx: idle::Context) -> ! { - rprintln!("idle"); loop { continue; } @@ -423,6 +411,12 @@ Cycle counter is at 6 cycles. // > cargo size --example rtt_timing --release --features nightly // // [Your answer here] +/* +cargo size --example rtt_timing --release --features nightly + Finished release [optimized + debuginfo] target(s) in 0.03s + text data bss dec hex filename + 664 0 0 664 298 rtt_timing +*/ // // I was able to get down to: // > cargo size --example rtt_timing --release --features nightly