uarte: Wait for the peripheral to be disabled
Prevents a panic in the case of: 1. Abort a receive future 2. Free Uarte::free() 3. Uarte::new() -> panicked at 'assertion failed: uarte.enable.read().enable().is_disabled()'
This commit is contained in:
parent
9b1f7b8a17
commit
93780fa31d
1 changed files with 2 additions and 0 deletions
|
@ -131,6 +131,8 @@ where
|
|||
}
|
||||
|
||||
pub fn free(self) -> (T, T::Interrupt, Pins) {
|
||||
// Wait for the peripheral to be disabled from the ISR.
|
||||
while self.instance.enable.read().enable().is_enabled() {}
|
||||
(self.instance, self.irq, self.pins)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue