Auto-enable all GPIOs during init().

This commit is contained in:
Bob McWhirter
2021-07-22 14:38:45 -04:00
parent e91c04a673
commit 13873df30b
4 changed files with 37 additions and 33 deletions

View File

@ -449,3 +449,13 @@ crate::pac::pins!(
}
};
);
pub(crate) unsafe fn init() {
crate::pac::gpio_rcc! {
($name:ident, $clock:ident, $en_reg:ident, $rst_reg:ident, $en_fn:ident, $rst_fn:ident) => {
crate::pac::RCC.$en_reg().modify(|reg| {
reg.$en_fn(true);
});
};
}
}

View File

@ -89,6 +89,7 @@ pub fn init(config: Config) -> Peripherals {
let p = Peripherals::take();
unsafe {
gpio::init();
dma::init();
#[cfg(exti)]
exti::init();