Move the `use` inside the macro call, inside another set of braces in case it percolates up twice.
@@ -47,17 +47,18 @@ pac::dma_channels! {
};
}
-use crate::rcc::sealed::RccPeripheral;
-
/// safety: must be called only once
pub(crate) unsafe fn init() {
pac::peripherals! {
(dmamux, $peri:ident) => {
+ {
pac::peripheral_rcc! {
($peri, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => {
+ use crate::rcc::sealed::RccPeripheral;
crate::peripherals::$peri::enable()
};
}
+ }
};
}
}
