Merge pull request #3993 from drindr/main

clean the SAADC's register while dropping
This commit is contained in:
Dario Nieuwenhuis 2025-03-24 00:25:56 +00:00 committed by GitHub
commit b7ea1dcd9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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));
}
}
}