aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-nrf/src/uarte.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/embassy-nrf/src/uarte.rs b/embassy-nrf/src/uarte.rs
index 024a86c91..63bbe5a77 100644
--- a/embassy-nrf/src/uarte.rs
+++ b/embassy-nrf/src/uarte.rs
@@ -187,13 +187,6 @@ impl<'d, T: Instance> Uarte<'d, T> {
187 s.endtx_waker.wake(); 187 s.endtx_waker.wake();
188 r.intenclr.write(|w| w.endtx().clear()); 188 r.intenclr.write(|w| w.endtx().clear());
189 } 189 }
190
191 if r.events_rxto.read().bits() != 0 {
192 r.intenclr.write(|w| w.rxto().clear());
193 }
194 if r.events_txstopped.read().bits() != 0 {
195 r.intenclr.write(|w| w.txstopped().clear());
196 }
197 } 190 }
198} 191}
199 192
@@ -208,15 +201,9 @@ impl<'a, T: Instance> Drop for Uarte<'a, T> {
208 info!("did_stoprx {} did_stoptx {}", did_stoprx, did_stoptx); 201 info!("did_stoprx {} did_stoptx {}", did_stoprx, did_stoptx);
209 202
210 // Wait for rxto or txstopped, if needed. 203 // Wait for rxto or txstopped, if needed.
211 r.intenset.write(|w| w.rxto().set().txstopped().set());
212 while (did_stoprx && r.events_rxto.read().bits() == 0) 204 while (did_stoprx && r.events_rxto.read().bits() == 0)
213 || (did_stoptx && r.events_txstopped.read().bits() == 0) 205 || (did_stoptx && r.events_txstopped.read().bits() == 0)
214 { 206 {}
215 info!("uarte drop: wfe");
216 cortex_m::asm::wfe();
217 }
218
219 cortex_m::asm::sev();
220 207
221 // Finally we can disable! 208 // Finally we can disable!
222 r.enable.write(|w| w.enable().disabled()); 209 r.enable.write(|w| w.enable().disabled());