From 3486d59d730ac6124290ced600c00c61133c0fdb Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 4 Jan 2022 23:58:57 +0100 Subject: [PATCH] stm32: remove Dbgmcu from public API. The use case is already covered by `config.enable_debug_during_sleep`. --- embassy-stm32/src/dbgmcu/mod.rs | 13 ------------- embassy-stm32/src/lib.rs | 10 +++++++--- 2 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 embassy-stm32/src/dbgmcu/mod.rs diff --git a/embassy-stm32/src/dbgmcu/mod.rs b/embassy-stm32/src/dbgmcu/mod.rs deleted file mode 100644 index 8dc4cc53..00000000 --- a/embassy-stm32/src/dbgmcu/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -pub struct Dbgmcu {} - -impl Dbgmcu { - pub unsafe fn enable_all() { - crate::pac::DBGMCU.cr().modify(|cr| { - crate::pac::dbgmcu! { - (cr, $fn_name:ident) => { - cr.$fn_name(true); - }; - } - }); - } -} diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 117f3ed2..bcd9bd5c 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs @@ -29,8 +29,6 @@ pub mod adc; pub mod can; #[cfg(dac)] pub mod dac; -#[cfg(dbgmcu)] -pub mod dbgmcu; #[cfg(dcmi)] pub mod dcmi; #[cfg(all(eth, feature = "net"))] @@ -90,7 +88,13 @@ pub fn init(config: Config) -> Peripherals { unsafe { if config.enable_debug_during_sleep { - dbgmcu::Dbgmcu::enable_all(); + crate::pac::DBGMCU.cr().modify(|cr| { + crate::pac::dbgmcu! { + (cr, $fn_name:ident) => { + cr.$fn_name(true); + }; + } + }); } gpio::init();