stm32l4: Cleanup examples

* Use `cortex_m_rt::entry` for sync examples
* Use `Dbgmcu::enable_all()` everywhere
This commit is contained in:
Timo Kröger
2021-07-29 15:54:11 +02:00
parent 2a4890165d
commit 4ccac69929
9 changed files with 48 additions and 75 deletions

View File

@@ -10,9 +10,10 @@
mod example_common;
use defmt::panic;
use embassy::executor::Spawner;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{Input, Pull};
use embassy_stm32::{pac, Peripherals};
use embassy_stm32::Peripherals;
use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
use example_common::*;
@@ -21,11 +22,7 @@ async fn main(_spawner: Spawner, p: Peripherals) {
info!("Hello World!");
unsafe {
pac::DBGMCU.cr().modify(|w| {
w.set_dbg_sleep(true);
w.set_dbg_standby(true);
w.set_dbg_stop(true);
});
Dbgmcu::enable_all();
}
let button = Input::new(p.PC13, Pull::Up);