Use embassy/defmt-timestamp-uptime in all examples.

This commit is contained in:
Dario Nieuwenhuis
2022-04-02 04:35:06 +02:00
parent a9e63167e1
commit 82803bffda
162 changed files with 490 additions and 765 deletions

View File

@ -6,8 +6,8 @@ version = "0.1.0"
resolver = "2"
[dependencies]
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "memory-x" ] }
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-timestamp-uptime"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "stm32u585ai", "time-driver-any", "memory-x" ] }
defmt = "0.3"
defmt-rtt = "0.3"

View File

@ -2,9 +2,9 @@
#![no_main]
#![feature(type_alias_impl_trait)]
#[path = "../example_common.rs"]
mod example_common;
use example_common::*;
use defmt::*;
use defmt_rtt as _; // global logger
use panic_probe as _;
use embassy_stm32 as _;

View File

@ -1,17 +0,0 @@
#![macro_use]
use defmt_rtt as _; // global logger
use panic_probe as _;
pub use defmt::*;
use core::sync::atomic::{AtomicUsize, Ordering};
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
}
}