Update example code

This commit is contained in:
Urhengulas
2021-02-22 22:24:38 +01:00
parent 1d0750653f
commit 5f8bc597c0
4 changed files with 5 additions and 11 deletions
+2 -8
View File
@@ -15,14 +15,8 @@ fn panic() -> ! {
cortex_m::asm::udf()
}
#[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
}
static COUNT: AtomicUsize = AtomicUsize::new(0);
defmt::timestamp!("{=usize}", COUNT.fetch_add(1, Ordering::Relaxed));
/// Terminates the application and makes `probe-run` exit with exit-code = 0
pub fn exit() -> ! {