summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorfnafnio <fabiopungg@gmail.com>2021-02-24 08:42:42 +0100
committerfnafnio <fabiopungg@gmail.com>2021-02-24 08:42:42 +0100
commit4e91d7b578a36649b0047aa1f2a99e9b3e55b81a (patch)
treebafe313aa4926b1c7785e0aa5a6cc001893cfe8e /examples
parentd6249f799c90cae96d61df4347daab7b93c90f10 (diff)
downloadnrf-softdevice-4e91d7b578a36649b0047aa1f2a99e9b3e55b81a.zip
fixed defmt::timestamp macro
Diffstat (limited to 'examples')
-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