diff options
| author | Timo Kröger <[email protected]> | 2021-07-29 15:24:42 +0200 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2021-07-29 15:35:23 +0200 |
| commit | 2a4890165d460324966a718fde9b712b06e3cc38 (patch) | |
| tree | b6b3feb9d376f4098b8f7f1985657063d9113079 /examples | |
| parent | 01e0a3928ff612654ece7fc4fac720e30736fee4 (diff) | |
stm32f0: Enable debug access in low power modes
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32f0/src/bin/hello.rs | 2 | ||||
| -rw-r--r-- | examples/stm32f0/src/example_common.rs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs index a78b9892f..6ebb5cd4d 100644 --- a/examples/stm32f0/src/bin/hello.rs +++ b/examples/stm32f0/src/bin/hello.rs | |||
| @@ -14,7 +14,7 @@ use embassy_stm32::Peripherals; | |||
| 14 | #[path = "../example_common.rs"] | 14 | #[path = "../example_common.rs"] |
| 15 | mod example_common; | 15 | mod example_common; |
| 16 | 16 | ||
| 17 | #[embassy::main] | 17 | #[embassy::main(config = "example_common::config()")] |
| 18 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { | 18 | async fn main(_spawner: Spawner, _p: Peripherals) -> ! { |
| 19 | loop { | 19 | loop { |
| 20 | Timer::after(Duration::from_secs(1)).await; | 20 | Timer::after(Duration::from_secs(1)).await; |
diff --git a/examples/stm32f0/src/example_common.rs b/examples/stm32f0/src/example_common.rs index 54d633837..e0ba4cd01 100644 --- a/examples/stm32f0/src/example_common.rs +++ b/examples/stm32f0/src/example_common.rs | |||
| @@ -6,6 +6,14 @@ use panic_probe as _; | |||
| 6 | pub use defmt::*; | 6 | pub use defmt::*; |
| 7 | 7 | ||
| 8 | use core::sync::atomic::{AtomicUsize, Ordering}; | 8 | use core::sync::atomic::{AtomicUsize, Ordering}; |
| 9 | use embassy_stm32::rcc; | ||
| 10 | use embassy_stm32::Config; | ||
| 11 | |||
| 12 | pub fn config() -> Config { | ||
| 13 | let mut rcc_config = rcc::Config::default(); | ||
| 14 | rcc_config.enable_debug_wfe = true; | ||
| 15 | Config::default().rcc(rcc_config) | ||
| 16 | } | ||
| 9 | 17 | ||
| 10 | defmt::timestamp! {"{=u64}", { | 18 | defmt::timestamp! {"{=u64}", { |
| 11 | static COUNT: AtomicUsize = AtomicUsize::new(0); | 19 | static COUNT: AtomicUsize = AtomicUsize::new(0); |
