Pull pads out of reset and wait

We're technically supposed to wait for these resets to finish before poking at registers. This seems to fix the instability I was seeing on the input example especially (TBH I have no idea how it ever worked)
This commit is contained in:
Jennifer Wilcox 2021-04-25 11:43:44 -05:00
parent 7e45c96a65
commit 8290368c10

View file

@ -95,7 +95,13 @@ macro_rules! gpio {
type Parts = Parts;
fn split(self, pads: pac::$PADSX, sio: pac::SIO, resets: &mut pac::RESETS) -> Parts {
resets.reset.modify(|_, w| w.$gpiox().clear_bit());
resets.reset.modify(|_, w| w.$gpiox().clear_bit().$padsx().clear_bit());
while resets.reset_done.read().$gpiox().bit_is_clear() {
cortex_m::asm::delay(10);
}
while resets.reset_done.read().$padsx().bit_is_clear() {
cortex_m::asm::delay(10);
}
Parts {
_pads: pads,
_sio: sio,