diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-04-02 04:35:06 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-04-02 04:35:06 +0200 |
| commit | 82803bffdab0842bf6c3e4bce21131d437b06669 (patch) | |
| tree | 588c65c93b31b897f53d389f7876dc2703eb0fa8 /examples/stm32f7/src/example_common.rs | |
| parent | a9e63167e1ec230ca3d28da771378f5f4936a840 (diff) | |
Use embassy/defmt-timestamp-uptime in all examples.
Diffstat (limited to 'examples/stm32f7/src/example_common.rs')
| -rw-r--r-- | examples/stm32f7/src/example_common.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/examples/stm32f7/src/example_common.rs b/examples/stm32f7/src/example_common.rs deleted file mode 100644 index a786cb114..000000000 --- a/examples/stm32f7/src/example_common.rs +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | #![macro_use] | ||
| 2 | |||
| 3 | use defmt_rtt as _; | ||
| 4 | use embassy_stm32::time::U32Ext; | ||
| 5 | use embassy_stm32::Config; | ||
| 6 | // global logger | ||
| 7 | use panic_probe as _; | ||
| 8 | |||
| 9 | pub use defmt::*; | ||
| 10 | |||
| 11 | use core::sync::atomic::{AtomicUsize, Ordering}; | ||
| 12 | |||
| 13 | defmt::timestamp! {"{=u64}", { | ||
| 14 | static COUNT: AtomicUsize = AtomicUsize::new(0); | ||
| 15 | // NOTE(no-CAS) `timestamps` runs with interrupts disabled | ||
| 16 | let n = COUNT.load(Ordering::Relaxed); | ||
| 17 | COUNT.store(n + 1, Ordering::Relaxed); | ||
| 18 | n as u64 | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | #[allow(unused)] | ||
| 23 | pub fn config() -> Config { | ||
| 24 | let mut config = Config::default(); | ||
| 25 | config.rcc.sys_ck = Some(200.mhz().into()); | ||
| 26 | config | ||
| 27 | } | ||
