diff options
| -rw-r--r-- | embassy-nrf/src/uarte.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs index 5ebcc8975..17417c0e2 100644 --- a/embassy-nrf/src/uarte.rs +++ b/embassy-nrf/src/uarte.rs | |||
| @@ -133,6 +133,10 @@ impl<'d, T: Instance> Uarte<'d, T> { | |||
| 133 | apply_workaround_for_enable_anomaly(&r); | 133 | apply_workaround_for_enable_anomaly(&r); |
| 134 | r.enable.write(|w| w.enable().enabled()); | 134 | r.enable.write(|w| w.enable().enabled()); |
| 135 | 135 | ||
| 136 | let s = T::state(); | ||
| 137 | |||
| 138 | s.tx_rx_refcount.store(2, Ordering::Relaxed); | ||
| 139 | |||
| 136 | Self { | 140 | Self { |
| 137 | phantom: PhantomData, | 141 | phantom: PhantomData, |
| 138 | tx: UarteTx::new(), | 142 | tx: UarteTx::new(), |
| @@ -584,7 +588,7 @@ pub(crate) mod sealed { | |||
| 584 | Self { | 588 | Self { |
| 585 | endrx_waker: AtomicWaker::new(), | 589 | endrx_waker: AtomicWaker::new(), |
| 586 | endtx_waker: AtomicWaker::new(), | 590 | endtx_waker: AtomicWaker::new(), |
| 587 | tx_rx_refcount: AtomicU8::new(2), | 591 | tx_rx_refcount: AtomicU8::new(0), |
| 588 | } | 592 | } |
| 589 | } | 593 | } |
| 590 | } | 594 | } |
