Get timestamp with interrupt disabled
This makes `app-template` support more platforms (i.e. `thumbv6`).
This commit is contained in:
+6
-1
@@ -16,7 +16,12 @@ fn panic() -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
||||||
defmt::timestamp!("{=usize}", COUNT.fetch_add(1, Ordering::Relaxed));
|
defmt::timestamp!("{=usize}", {
|
||||||
|
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
||||||
|
let n = COUNT.load(Ordering::Relaxed);
|
||||||
|
COUNT.store(n + 1, Ordering::Relaxed);
|
||||||
|
n
|
||||||
|
});
|
||||||
|
|
||||||
/// Terminates the application and makes `probe-run` exit with exit-code = 0
|
/// Terminates the application and makes `probe-run` exit with exit-code = 0
|
||||||
pub fn exit() -> ! {
|
pub fn exit() -> ! {
|
||||||
|
|||||||
Reference in New Issue
Block a user