Move the use inside the macro call, inside another set of braces in case it percolates up twice.

This commit is contained in:
Bob McWhirter 2021-10-26 14:34:03 -04:00
parent a72816492a
commit bbff98ed0d

View File

@ -47,16 +47,17 @@ 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) => {
crate::peripherals::$peri::enable()
};
{
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()
};
}
}
};
}