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()'
@@ -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)
}
