diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-02-25 01:16:23 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-02-25 01:16:23 +0100 |
| commit | 0ad7a3aa6f5d2ce3d59c36b7c428b229645f160a (patch) | |
| tree | 42ce88eab28306bd78b5aaf22f7809017e881d57 | |
| parent | 5163de6094455c230f84fa064c96da7987f5e3f8 (diff) | |
stm32: fix chips without dbgmcu (wl55 cm0 core)
| -rw-r--r-- | embassy-stm32/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 9c94e5f3f..79221e600 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -76,6 +76,7 @@ pub use generated::{peripherals, Peripherals}; | |||
| 76 | #[non_exhaustive] | 76 | #[non_exhaustive] |
| 77 | pub struct Config { | 77 | pub struct Config { |
| 78 | pub rcc: rcc::Config, | 78 | pub rcc: rcc::Config, |
| 79 | #[cfg(dbgmcu)] | ||
| 79 | pub enable_debug_during_sleep: bool, | 80 | pub enable_debug_during_sleep: bool, |
| 80 | } | 81 | } |
| 81 | 82 | ||
| @@ -83,6 +84,7 @@ impl Default for Config { | |||
| 83 | fn default() -> Self { | 84 | fn default() -> Self { |
| 84 | Self { | 85 | Self { |
| 85 | rcc: Default::default(), | 86 | rcc: Default::default(), |
| 87 | #[cfg(dbgmcu)] | ||
| 86 | enable_debug_during_sleep: true, | 88 | enable_debug_during_sleep: true, |
| 87 | } | 89 | } |
| 88 | } | 90 | } |
| @@ -93,6 +95,7 @@ pub fn init(config: Config) -> Peripherals { | |||
| 93 | let p = Peripherals::take(); | 95 | let p = Peripherals::take(); |
| 94 | 96 | ||
| 95 | unsafe { | 97 | unsafe { |
| 98 | #[cfg(dbgmcu)] | ||
| 96 | if config.enable_debug_during_sleep { | 99 | if config.enable_debug_during_sleep { |
| 97 | crate::pac::DBGMCU.cr().modify(|cr| { | 100 | crate::pac::DBGMCU.cr().modify(|cr| { |
| 98 | crate::pac::dbgmcu! { | 101 | crate::pac::dbgmcu! { |
