aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/src/rcc/h7/mod.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/embassy-stm32/src/rcc/h7/mod.rs b/embassy-stm32/src/rcc/h7/mod.rs
index 8112ae999..4f73835f9 100644
--- a/embassy-stm32/src/rcc/h7/mod.rs
+++ b/embassy-stm32/src/rcc/h7/mod.rs
@@ -5,7 +5,7 @@ use embassy::util::Unborrow;
5use crate::fmt::{assert, panic}; 5use crate::fmt::{assert, panic};
6use crate::pac::peripherals; 6use crate::pac::peripherals;
7use crate::pac::rcc::vals::Timpre; 7use crate::pac::rcc::vals::Timpre;
8use crate::pac::{RCC, SYSCFG}; 8use crate::pac::{DBGMCU, RCC, SYSCFG};
9use crate::pwr::{Power, VoltageScale}; 9use crate::pwr::{Power, VoltageScale};
10use crate::time::Hertz; 10use crate::time::Hertz;
11 11
@@ -365,15 +365,21 @@ impl<'d> Rcc<'d> {
365 /// 365 ///
366 /// Set `enable_dma1` to true if you do not have at least one bus master (other than the CPU) 366 /// Set `enable_dma1` to true if you do not have at least one bus master (other than the CPU)
367 /// enable during WFI/WFE 367 /// enable during WFI/WFE
368 pub fn enable_debug_wfe(&mut self, enable_dma1: bool) { 368 pub fn enable_debug_wfe(&mut self, _dbg: &mut peripherals::DBGMCU, enable_dma1: bool) {
369 use crate::pac::rcc::vals::Ahb1enrDma1en; 369 use crate::pac::rcc::vals::Ahb1enrDma1en;
370 370
371 // NOTE(unsafe) We have exclusive access to the RCC 371 // NOTE(unsafe) We have exclusive access to the RCC and DBGMCU
372 unsafe { 372 unsafe {
373 if enable_dma1 { 373 if enable_dma1 {
374 RCC.ahb1enr() 374 RCC.ahb1enr()
375 .modify(|w| w.set_dma1en(Ahb1enrDma1en::ENABLED)); 375 .modify(|w| w.set_dma1en(Ahb1enrDma1en::ENABLED));
376 } 376 }
377
378 DBGMCU.cr().modify(|w| {
379 w.set_dbgsleep_d1(true);
380 w.set_dbgstby_d1(true);
381 w.set_dbgstop_d1(true);
382 });
377 } 383 }
378 } 384 }
379 385