summaryrefslogtreecommitdiff
path: root/examples/src/example_common.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/example_common.rs')
-rw-r--r--examples/src/example_common.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/src/example_common.rs b/examples/src/example_common.rs
index 7c8cdb1..adbe86f 100644
--- a/examples/src/example_common.rs
+++ b/examples/src/example_common.rs
@@ -23,13 +23,13 @@ fn alloc_error(_layout: Layout) -> ! {
const HEAP_SIZE: usize = 32 * 1024; // in bytes
-#[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
+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
+ }
}
// Take peripherals, split by softdevice and application