Skip to content

Commit 352ad75

Browse files
committed
Add note about mono_timer and hprintln and run cargo fmt
1 parent 731b94d commit 352ad75

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/time.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//! ```
2929
3030
use core::ops;
31-
use cortex_m::peripheral::{DWT, DCB};
31+
use cortex_m::peripheral::{DCB, DWT};
3232

3333
use crate::rcc::Clocks;
3434

@@ -227,6 +227,11 @@ impl_arithmetic!(MegaHertz, u32);
227227
impl_arithmetic!(Bps, u32);
228228

229229
/// A monotonic non-decreasing timer
230+
///
231+
/// This uses the timer in the debug watch trace peripheral. This means, that if the
232+
/// core is stopped, the timer does not count up. This may be relevant if you are using
233+
/// cortex_m_semihosting::hprintln for debugging in which case the timer will be stopped
234+
/// while printing
230235
#[derive(Clone, Copy)]
231236
pub struct MonoTimer {
232237
frequency: Hertz,

0 commit comments

Comments
 (0)