Use Dbgmcu::enable_all() in stm32f4 examples

This commit is contained in:
Timo Kröger 2021-07-23 17:49:53 +02:00
parent 5ac91933ff
commit 57eecd4292
6 changed files with 10 additions and 39 deletions

View file

@ -8,8 +8,8 @@
#[path = "../example_common.rs"]
mod example_common;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::gpio::{Level, Output, Speed};
use embassy_stm32::pac;
use embedded_hal::digital::v2::OutputPin;
use example_common::*;
@ -20,11 +20,7 @@ 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());

View file

@ -9,8 +9,8 @@
#[path = "../example_common.rs"]
mod example_common;
use cortex_m_rt::entry;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
use embassy_stm32::pac;
use embedded_hal::digital::v2::{InputPin, OutputPin};
use example_common::*;
@ -19,11 +19,7 @@ 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());

View file

@ -10,6 +10,7 @@
mod example_common;
use embassy::executor::Executor;
use embassy::util::Forever;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::exti::ExtiInput;
use embassy_stm32::gpio::{Input, Pull};
use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
@ -42,11 +43,7 @@ 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();
// EXTI clock
pac::RCC.apb2enr().modify(|w| {

View file

@ -15,7 +15,6 @@ use example_common::*;
use cortex_m_rt::entry;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::pac;
use embassy_stm32::spi::{Config, Spi};
use embassy_stm32::time::Hertz;
use embedded_hal::blocking::spi::Transfer;

View file

@ -11,12 +11,12 @@ mod example_common;
use cortex_m::prelude::_embedded_hal_blocking_serial_Write;
use embassy::executor::Executor;
use embassy::util::Forever;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::dma::NoDma;
use embassy_stm32::usart::{Config, Uart};
use example_common::*;
use cortex_m_rt::entry;
use embassy_stm32::pac;
#[embassy::task]
async fn main_task() {
@ -42,11 +42,7 @@ 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 executor = EXECUTOR.put(Executor::new());

View file

@ -12,8 +12,8 @@ use core::fmt::Write;
use cortex_m_rt::entry;
use embassy::executor::Executor;
use embassy::util::Forever;
use embassy_stm32::dbgmcu::Dbgmcu;
use embassy_stm32::dma::NoDma;
use embassy_stm32::pac;
use embassy_stm32::usart::{Config, Uart};
use embassy_traits::uart::Write as _;
use example_common::*;
@ -42,20 +42,7 @@ 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);
});
pac::RCC.ahb1enr().modify(|w| {
w.set_gpioaen(true);
w.set_gpioben(true);
w.set_gpiocen(true);
w.set_gpioden(true);
w.set_gpioeen(true);
w.set_gpiofen(true);
});
Dbgmcu::enable_all();
}
let executor = EXECUTOR.put(Executor::new());