Initial swag at h7 examples.

This commit is contained in:
Bob McWhirter
2021-06-08 14:47:32 -04:00
parent 8f8914a789
commit 4f1f63f336
5 changed files with 140 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
#![macro_use]
use defmt_rtt as _; // global logger
use panic_probe as _;
pub use defmt::*;
use core::sync::atomic::{AtomicUsize, Ordering};
defmt::timestamp! {"{=u64}", {
static COUNT: AtomicUsize = AtomicUsize::new(0);
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
let n = COUNT.load(Ordering::Relaxed);
COUNT.store(n + 1, Ordering::Relaxed);
n as u64
}
}