stm32l4: Cleanup examples
* Use `cortex_m_rt::entry` for sync examples * Use `Dbgmcu::enable_all()` everywhere
This commit is contained in:
@@ -8,25 +8,21 @@
|
||||
|
||||
#[path = "../example_common.rs"]
|
||||
mod example_common;
|
||||
use defmt::panic;
|
||||
use embassy::executor::Spawner;
|
||||
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||
use embassy_stm32::gpio::{Input, Pull};
|
||||
use embassy_stm32::{pac, Peripherals};
|
||||
use embedded_hal::digital::v2::InputPin;
|
||||
use example_common::*;
|
||||
|
||||
#[embassy::main]
|
||||
async fn main(_spawner: Spawner, p: Peripherals) {
|
||||
#[cortex_m_rt::entry]
|
||||
fn main() -> ! {
|
||||
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 p = embassy_stm32::init(Default::default());
|
||||
|
||||
let button = Input::new(p.PC13, Pull::Up);
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user