nrf/buffered_uarte: Fix crash when calling set_baudrate as the very first thing.

This commit is contained in:
Dario Nieuwenhuis 2021-06-08 00:30:22 +02:00
parent 51d5f19983
commit d1eeef5864

View File

@ -177,7 +177,9 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> {
} }
pub fn set_baudrate(self: Pin<&mut Self>, baudrate: Baudrate) { pub fn set_baudrate(self: Pin<&mut Self>, baudrate: Baudrate) {
self.inner().with(|state, _irq| { let mut inner = self.inner();
inner.as_mut().register_interrupt();
inner.with(|state, _irq| {
let r = U::regs(); let r = U::regs();
let rt = state.timer.regs(); let rt = state.timer.regs();