aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32h7
diff options
context:
space:
mode:
authorBob McWhirter <[email protected]>2021-07-23 11:21:02 -0400
committerGitHub <[email protected]>2021-07-23 11:21:02 -0400
commite91c04a6730fc90df296bd0bee0c7262262fbbda (patch)
treee5f6ac816921ef0eca6118a331147af028465ecc /examples/stm32h7
parent3655ceff279159b757d7a04ffac3483a7bf5c7b4 (diff)
parentd68f2617e663c933c11d5406c7ae12abc5e82938 (diff)
Merge pull request #310 from bobmcwhirter/dbg
Add a `Dbgmcu` struct capable of enabling all relevant DBGMCU.cr fields.
Diffstat (limited to 'examples/stm32h7')
-rw-r--r--examples/stm32h7/src/bin/usart_dma.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/stm32h7/src/bin/usart_dma.rs b/examples/stm32h7/src/bin/usart_dma.rs
index 0073d5c66..097466cea 100644
--- a/examples/stm32h7/src/bin/usart_dma.rs
+++ b/examples/stm32h7/src/bin/usart_dma.rs
@@ -14,6 +14,7 @@ use embassy::time::Clock;
14use embassy::util::Forever; 14use embassy::util::Forever;
15use embassy_stm32::dma::NoDma; 15use embassy_stm32::dma::NoDma;
16use embassy_stm32::usart::{Config, Uart}; 16use embassy_stm32::usart::{Config, Uart};
17use embassy_stm32::dbgmcu::Dbgmcu;
17use example_common::*; 18use example_common::*;
18use embassy_traits::uart::Write as _Write; 19use embassy_traits::uart::Write as _Write;
19 20
@@ -72,13 +73,9 @@ fn main() -> ! {
72 73
73 let pp = unsafe { pac::Peripherals::steal() }; 74 let pp = unsafe { pac::Peripherals::steal() };
74 75
75 pp.DBGMCU.cr.modify(|_, w| { 76 unsafe {
76 w.dbgsleep_d1().set_bit(); 77 Dbgmcu::enable_all();
77 w.dbgstby_d1().set_bit(); 78 }
78 w.dbgstop_d1().set_bit();
79 w.d1dbgcken().set_bit();
80 w
81 });
82 79
83 pp.RCC.ahb4enr.modify(|_, w| { 80 pp.RCC.ahb4enr.modify(|_, w| {
84 w.gpioaen().set_bit(); 81 w.gpioaen().set_bit();