stm32f0: Enable debug access in low power modes

This commit is contained in:
Timo Kröger
2021-07-29 15:24:42 +02:00
parent 01e0a3928f
commit 2a4890165d
3 changed files with 12 additions and 8 deletions

View File

@ -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;

View File

@ -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);