stm32: fix chips without dbgmcu (wl55 cm0 core)
This commit is contained in:
parent
5163de6094
commit
0ad7a3aa6f
@ -76,6 +76,7 @@ pub use generated::{peripherals, Peripherals};
|
|||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub rcc: rcc::Config,
|
pub rcc: rcc::Config,
|
||||||
|
#[cfg(dbgmcu)]
|
||||||
pub enable_debug_during_sleep: bool,
|
pub enable_debug_during_sleep: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +84,7 @@ impl Default for Config {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
rcc: Default::default(),
|
rcc: Default::default(),
|
||||||
|
#[cfg(dbgmcu)]
|
||||||
enable_debug_during_sleep: true,
|
enable_debug_during_sleep: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -93,6 +95,7 @@ pub fn init(config: Config) -> Peripherals {
|
|||||||
let p = Peripherals::take();
|
let p = Peripherals::take();
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
#[cfg(dbgmcu)]
|
||||||
if config.enable_debug_during_sleep {
|
if config.enable_debug_during_sleep {
|
||||||
crate::pac::DBGMCU.cr().modify(|cr| {
|
crate::pac::DBGMCU.cr().modify(|cr| {
|
||||||
crate::pac::dbgmcu! {
|
crate::pac::dbgmcu! {
|
||||||
|
Loading…
Reference in New Issue
Block a user