Clear unused pulls in set_pull.

This commit is contained in:
Simon Berg 2022-12-09 20:30:17 +01:00
parent cd59046e6c
commit 488e322478

View File

@ -476,11 +476,13 @@ impl<'d, T: Pin> Flex<'d, T> {
unsafe {
self.pin.pad_ctrl().modify(|w| {
w.set_ie(true);
match pull {
Pull::Up => w.set_pue(true),
Pull::Down => w.set_pde(true),
Pull::None => {}
}
let (pu, pd) = match pull {
Pull::Up => (true, false),
Pull::Down => (false, true),
Pull::None => (false, false),
};
w.set_pue(pu);
w.set_pde(pd);
});
}
}