summaryrefslogtreecommitdiff
path: root/examples/stm32f0
diff options
context:
space:
mode:
authorTimo Kröger <timokroeger93@gmail.com>2021-07-29 15:24:42 +0200
committerTimo Kröger <timokroeger93@gmail.com>2021-07-29 15:35:23 +0200
commit2a4890165d460324966a718fde9b712b06e3cc38 (patch)
treeb6b3feb9d376f4098b8f7f1985657063d9113079 /examples/stm32f0
parent01e0a3928ff612654ece7fc4fac720e30736fee4 (diff)
downloadembassy-2a4890165d460324966a718fde9b712b06e3cc38.zip
stm32f0: Enable debug access in low power modes
Diffstat (limited to 'examples/stm32f0')
-rw-r--r--examples/stm32f0/src/bin/hello.rs2
-rw-r--r--examples/stm32f0/src/example_common.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/stm32f0/src/bin/hello.rs b/examples/stm32f0/src/bin/hello.rs
index a78b9892..6ebb5cd4 100644
--- a/examples/stm32f0/src/bin/hello.rs
+++ b/examples/stm32f0/src/bin/hello.rs
@@ -14,7 +14,7 @@ use embassy_stm32::Peripherals;
#[path = "../example_common.rs"]
mod example_common;
-#[embassy::main]
+#[embassy::main(config = "example_common::config()")]
async fn main(_spawner: Spawner, _p: Peripherals) -> ! {
loop {
Timer::after(Duration::from_secs(1)).await;
diff --git a/examples/stm32f0/src/example_common.rs b/examples/stm32f0/src/example_common.rs
index 54d63383..e0ba4cd0 100644
--- a/examples/stm32f0/src/example_common.rs
+++ b/examples/stm32f0/src/example_common.rs
@@ -6,6 +6,14 @@ use panic_probe as _;
pub use defmt::*;
use core::sync::atomic::{AtomicUsize, Ordering};
+use embassy_stm32::rcc;
+use embassy_stm32::Config;
+
+pub fn config() -> Config {
+ let mut rcc_config = rcc::Config::default();
+ rcc_config.enable_debug_wfe = true;
+ Config::default().rcc(rcc_config)
+}
defmt::timestamp! {"{=u64}", {
static COUNT: AtomicUsize = AtomicUsize::new(0);