Skip to content

Commit 068e423

Browse files
committed
Use monotonic as the defmt timestamp.
1 parent 9ea09f1 commit 068e423

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

neotron-bmc-pico/src/lib.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#![no_std]
22

3-
use core::sync::atomic::{AtomicUsize, Ordering};
4-
53
use defmt_rtt as _; // global logger
64
use panic_probe as _;
75
use stm32f0xx_hal as _; // memory layout // panic handler
@@ -17,14 +15,6 @@ fn panic() -> ! {
1715
cortex_m::asm::udf()
1816
}
1917

20-
static COUNT: AtomicUsize = AtomicUsize::new(0);
21-
defmt::timestamp!("{=usize}", {
22-
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
23-
let n = COUNT.load(Ordering::Relaxed);
24-
COUNT.store(n + 1, Ordering::Relaxed);
25-
n
26-
});
27-
2818
/// Terminates the application and makes `probe-run` exit with exit-code = 0
2919
pub fn exit() -> ! {
3020
loop {

neotron-bmc-pico/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ mod app {
7575
use super::*;
7676
use systick_monotonic::*; // Implements the `Monotonic` trait
7777

78+
defmt::timestamp!("{=u64}", monotonics::now().ticks());
79+
7880
pub enum Message {
7981
/// Word from PS/2 port 0
8082
Ps2Data0(u16),

0 commit comments

Comments
 (0)