From 416e48983c0598caee3071727b9f4f590a65ae1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvin=20=C3=85kerfeldt?= <Edvin Ã…kerfeldt> Date: Thu, 3 Dec 2020 13:38:22 +0100 Subject: [PATCH] rtt_timing, F post sizify complete --- examples/rtt_timing.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs index fb6ddfb..96bf43a 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 -- GitLab