From a72816492ac09898fc7d72fe20cc0e025d5292a6 Mon Sep 17 00:00:00 2001 From: Bob McWhirter Date: Tue, 26 Oct 2021 14:19:03 -0400 Subject: [PATCH] Only attempt to enable the dmamux peri clock if it has an enable bit. --- embassy-stm32/src/dma/dmamux.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/embassy-stm32/src/dma/dmamux.rs b/embassy-stm32/src/dma/dmamux.rs index ef84f126..4ce65eb2 100644 --- a/embassy-stm32/src/dma/dmamux.rs +++ b/embassy-stm32/src/dma/dmamux.rs @@ -53,7 +53,11 @@ use crate::rcc::sealed::RccPeripheral; pub(crate) unsafe fn init() { pac::peripherals! { (dmamux, $peri:ident) => { - crate::peripherals::$peri::enable(); + pac::peripheral_rcc! { + ($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => { + crate::peripherals::$peri::enable() + }; + } }; } }