Properly initialise refcount
This commit is contained in:
parent
bb03b5cc02
commit
0642eec01e
@ -133,6 +133,10 @@ impl<'d, T: Instance> Uarte<'d, T> {
|
|||||||
apply_workaround_for_enable_anomaly(&r);
|
apply_workaround_for_enable_anomaly(&r);
|
||||||
r.enable.write(|w| w.enable().enabled());
|
r.enable.write(|w| w.enable().enabled());
|
||||||
|
|
||||||
|
let s = T::state();
|
||||||
|
|
||||||
|
s.tx_rx_refcount.store(2, Ordering::Relaxed);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
tx: UarteTx::new(),
|
tx: UarteTx::new(),
|
||||||
@ -584,7 +588,7 @@ pub(crate) mod sealed {
|
|||||||
Self {
|
Self {
|
||||||
endrx_waker: AtomicWaker::new(),
|
endrx_waker: AtomicWaker::new(),
|
||||||
endtx_waker: AtomicWaker::new(),
|
endtx_waker: AtomicWaker::new(),
|
||||||
tx_rx_refcount: AtomicU8::new(2),
|
tx_rx_refcount: AtomicU8::new(0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user