Disable the UART for real when disabling UART.

This commit is contained in:
Nic0w 2021-04-25 20:25:29 +02:00
parent c50a5b6001
commit aa3fe8fd20

View file

@ -184,6 +184,15 @@ impl<D: UARTDevice> UARTPeripheral<Enabled, D> {
/// Disable this UART Peripheral, falling back to the Disabled state. /// Disable this UART Peripheral, falling back to the Disabled state.
pub fn disable(self) -> UARTPeripheral<Disabled, D> { pub fn disable(self) -> UARTPeripheral<Disabled, D> {
// Disable the UART, both TX and RX
self.device.uartcr.write(|w| {
w.uarten().clear_bit();
w.txe().clear_bit();
w.rxe().clear_bit();
w
});
self.transition(Disabled) self.transition(Disabled)
} }