Browse Source

Add note about mono_timer and hprintln and run cargo fmt

TheZoq2 3 years ago
parent
commit
352ad75247
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/time.rs

+ 6 - 1
src/time.rs

@@ -28,7 +28,7 @@
 //! ```
 
 use core::ops;
-use cortex_m::peripheral::{DWT, DCB};
+use cortex_m::peripheral::{DCB, DWT};
 
 use crate::rcc::Clocks;
 
@@ -227,6 +227,11 @@ impl_arithmetic!(MegaHertz, u32);
 impl_arithmetic!(Bps, u32);
 
 /// A monotonic non-decreasing timer
+///
+/// This uses the timer in the debug watch trace peripheral. This means, that if the
+/// core is stopped, the timer does not count up. This may be relevant if you are using
+/// cortex_m_semihosting::hprintln for debugging in which case the timer will be stopped
+/// while printing
 #[derive(Clone, Copy)]
 pub struct MonoTimer {
     frequency: Hertz,