clean the SAADC's register while dropping
This commit is contained in:
parent
4033a619a8
commit
816aa9a06c
@ -465,6 +465,10 @@ impl<'d, const N: usize> Drop for Saadc<'d, N> {
|
||||
fn drop(&mut self) {
|
||||
let r = Self::regs();
|
||||
r.enable().write(|w| w.set_enable(false));
|
||||
for i in 0..N {
|
||||
r.ch(i).pselp().write(|w| w.set_pselp(InputChannel::NC));
|
||||
r.ch(i).pseln().write(|w| w.set_pseln(InputChannel::NC));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user