aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob McWhirter <[email protected]>2021-10-26 14:34:03 -0400
committerBob McWhirter <[email protected]>2021-10-26 14:34:03 -0400
commitbbff98ed0de2f37cc25f00b944bb0afb1bb85646 (patch)
tree4d4a4f6fcd1ef795ab3a10b568e057e984e03f79
parenta72816492ac09898fc7d72fe20cc0e025d5292a6 (diff)
Move the `use` inside the macro call, inside another set of braces in case it percolates up twice.
-rw-r--r--embassy-stm32/src/dma/dmamux.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/embassy-stm32/src/dma/dmamux.rs b/embassy-stm32/src/dma/dmamux.rs
index 4ce65eb21..14218d56a 100644
--- a/embassy-stm32/src/dma/dmamux.rs
+++ b/embassy-stm32/src/dma/dmamux.rs
@@ -47,16 +47,17 @@ pac::dma_channels! {
47 }; 47 };
48} 48}
49 49
50use crate::rcc::sealed::RccPeripheral;
51
52/// safety: must be called only once 50/// safety: must be called only once
53pub(crate) unsafe fn init() { 51pub(crate) unsafe fn init() {
54 pac::peripherals! { 52 pac::peripherals! {
55 (dmamux, $peri:ident) => { 53 (dmamux, $peri:ident) => {
56 pac::peripheral_rcc! { 54 {
57 ($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => { 55 pac::peripheral_rcc! {
58 crate::peripherals::$peri::enable() 56 ($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => {
59 }; 57 use crate::rcc::sealed::RccPeripheral;
58 crate::peripherals::$peri::enable()
59 };
60 }
60 } 61 }
61 }; 62 };
62 } 63 }