diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-02-26 00:30:00 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-26 00:30:00 +0100 |
| commit | de796d3e80cb7af24bcf4c9cc0f8167bfa93cc84 (patch) | |
| tree | 1447fd25a47ad4a57a1eded409f9520111cff308 /embassy-stm32f4-examples | |
| parent | d4a97ac3ed79272fbded607c5f7dc1d745fc2b66 (diff) | |
| parent | 2893fb37331ec4196cc37ae36fa121d0eee73383 (diff) | |
Merge pull request #53 from fnafnio/defmt-update
update defmt and defmt-rtt to 0.2.0
Diffstat (limited to 'embassy-stm32f4-examples')
| -rw-r--r-- | embassy-stm32f4-examples/.cargo/config | 2 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/Cargo.toml | 4 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/example_common.rs | 14 |
3 files changed, 10 insertions, 10 deletions
diff --git a/embassy-stm32f4-examples/.cargo/config b/embassy-stm32f4-examples/.cargo/config index 836853988..3ccca879d 100644 --- a/embassy-stm32f4-examples/.cargo/config +++ b/embassy-stm32f4-examples/.cargo/config | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] |
| 2 | runner = "probe-run --chip STM32F401CCUx --defmt" | 2 | runner = "probe-run --chip STM32F401CCUx" |
| 3 | 3 | ||
| 4 | rustflags = [ | 4 | rustflags = [ |
| 5 | # LLD (shipped with the Rust toolchain) is used as the default linker | 5 | # LLD (shipped with the Rust toolchain) is used as the default linker |
diff --git a/embassy-stm32f4-examples/Cargo.toml b/embassy-stm32f4-examples/Cargo.toml index 216964374..3e117ecb0 100644 --- a/embassy-stm32f4-examples/Cargo.toml +++ b/embassy-stm32f4-examples/Cargo.toml | |||
| @@ -20,8 +20,8 @@ defmt-error = [] | |||
| 20 | embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } | 20 | embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } |
| 21 | embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4", features = ["stm32f401"] } | 21 | embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4", features = ["stm32f401"] } |
| 22 | 22 | ||
| 23 | defmt = "0.1.3" | 23 | defmt = "0.2.0" |
| 24 | defmt-rtt = "0.1.0" | 24 | defmt-rtt = "0.2.0" |
| 25 | 25 | ||
| 26 | cortex-m = "0.7.1" | 26 | cortex-m = "0.7.1" |
| 27 | cortex-m-rt = "0.6.13" | 27 | cortex-m-rt = "0.6.13" |
diff --git a/embassy-stm32f4-examples/src/example_common.rs b/embassy-stm32f4-examples/src/example_common.rs index ff4d8575e..54d633837 100644 --- a/embassy-stm32f4-examples/src/example_common.rs +++ b/embassy-stm32f4-examples/src/example_common.rs | |||
| @@ -7,11 +7,11 @@ pub use defmt::*; | |||
| 7 | 7 | ||
| 8 | use core::sync::atomic::{AtomicUsize, Ordering}; | 8 | use core::sync::atomic::{AtomicUsize, Ordering}; |
| 9 | 9 | ||
| 10 | #[defmt::timestamp] | 10 | defmt::timestamp! {"{=u64}", { |
| 11 | fn timestamp() -> u64 { | 11 | static COUNT: AtomicUsize = AtomicUsize::new(0); |
| 12 | static COUNT: AtomicUsize = AtomicUsize::new(0); | 12 | // NOTE(no-CAS) `timestamps` runs with interrupts disabled |
| 13 | // NOTE(no-CAS) `timestamps` runs with interrupts disabled | 13 | let n = COUNT.load(Ordering::Relaxed); |
| 14 | let n = COUNT.load(Ordering::Relaxed); | 14 | COUNT.store(n + 1, Ordering::Relaxed); |
| 15 | COUNT.store(n + 1, Ordering::Relaxed); | 15 | n as u64 |
| 16 | n as u64 | 16 | } |
| 17 | } | 17 | } |
