diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/Cargo.toml | 3 | ||||
| -rw-r--r-- | tests/stm32/src/example_common.rs | 11 |
2 files changed, 2 insertions, 12 deletions
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index eca470358..5cd949661 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -22,8 +22,9 @@ not-gpdma = [] | |||
| 22 | [dependencies] | 22 | [dependencies] |
| 23 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } | 23 | embassy-sync = { version = "0.2.0", path = "../../embassy-sync", features = ["defmt"] } |
| 24 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 24 | embassy-executor = { version = "0.2.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 25 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768"] } | 25 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "tick-hz-32_768", "defmt-timestamp-uptime"] } |
| 26 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } | 26 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "unstable-pac", "memory-x", "time-driver-any"] } |
| 27 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | ||
| 27 | 28 | ||
| 28 | defmt = "0.3.0" | 29 | defmt = "0.3.0" |
| 29 | defmt-rtt = "0.4" | 30 | defmt-rtt = "0.4" |
diff --git a/tests/stm32/src/example_common.rs b/tests/stm32/src/example_common.rs index c47ed75c4..a4f8668c7 100644 --- a/tests/stm32/src/example_common.rs +++ b/tests/stm32/src/example_common.rs | |||
| @@ -1,22 +1,11 @@ | |||
| 1 | #![macro_use] | 1 | #![macro_use] |
| 2 | 2 | ||
| 3 | use core::sync::atomic::{AtomicUsize, Ordering}; | ||
| 4 | |||
| 5 | pub use defmt::*; | 3 | pub use defmt::*; |
| 6 | #[allow(unused)] | 4 | #[allow(unused)] |
| 7 | use embassy_stm32::time::Hertz; | 5 | use embassy_stm32::time::Hertz; |
| 8 | use embassy_stm32::Config; | 6 | use embassy_stm32::Config; |
| 9 | use {defmt_rtt as _, panic_probe as _}; | 7 | use {defmt_rtt as _, panic_probe as _}; |
| 10 | 8 | ||
| 11 | defmt::timestamp! {"{=u64}", { | ||
| 12 | static COUNT: AtomicUsize = AtomicUsize::new(0); | ||
| 13 | // NOTE(no-CAS) `timestamps` runs with interrupts disabled | ||
| 14 | let n = COUNT.load(Ordering::Relaxed); | ||
| 15 | COUNT.store(n + 1, Ordering::Relaxed); | ||
| 16 | n as u64 | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | pub fn config() -> Config { | 9 | pub fn config() -> Config { |
| 21 | #[allow(unused_mut)] | 10 | #[allow(unused_mut)] |
| 22 | let mut config = Config::default(); | 11 | let mut config = Config::default(); |
