embassy/examples/src/example_common.rs
Dario Nieuwenhuis 78135a81d9 Remove anyfmt
2020-11-27 18:42:59 +01:00

18 lines
428 B
Rust

#![macro_use]
use defmt_rtt as _; // global logger
use nrf52840_hal as _;
use panic_probe as _;
pub use defmt::*;
use core::sync::atomic::{AtomicUsize, Ordering};
#[defmt::timestamp]
fn 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
}