aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMick van Gelderen <[email protected]>2023-11-21 15:37:38 +0100
committerMick van Gelderen <[email protected]>2023-11-21 15:37:38 +0100
commit19ba7da3fde7ad4d0c5896812fbeb902791cc5bc (patch)
tree4779d70d966d3e3666ba926444d76d7c9bf4dfe0
parent06a83c0f897d0fe39c59e33b14d9b4f0cd705a0b (diff)
Rename _flush* methods
-rw-r--r--embassy-stm32/src/can/bxcan.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/embassy-stm32/src/can/bxcan.rs b/embassy-stm32/src/can/bxcan.rs
index 85dbe714f..13fffd746 100644
--- a/embassy-stm32/src/can/bxcan.rs
+++ b/embassy-stm32/src/can/bxcan.rs
@@ -212,17 +212,17 @@ impl<'d, T: Instance> Can<'d, T> {
212 212
213 /// Waits for a specific transmit mailbox to become empty 213 /// Waits for a specific transmit mailbox to become empty
214 pub async fn flush(&self, mb: bxcan::Mailbox) { 214 pub async fn flush(&self, mb: bxcan::Mailbox) {
215 CanTx::<T>::_flush(mb).await 215 CanTx::<T>::flush_inner(mb).await
216 } 216 }
217 217
218 /// Waits until any of the transmit mailboxes become empty 218 /// Waits until any of the transmit mailboxes become empty
219 pub async fn flush_any(&self) { 219 pub async fn flush_any(&self) {
220 CanTx::<T>::_flush_any().await 220 CanTx::<T>::flush_any_inner().await
221 } 221 }
222 222
223 /// Waits until all of the transmit mailboxes become empty 223 /// Waits until all of the transmit mailboxes become empty
224 pub async fn flush_all(&self) { 224 pub async fn flush_all(&self) {
225 CanTx::<T>::_flush_all().await 225 CanTx::<T>::flush_all_inner().await
226 } 226 }
227 227
228 /// Returns a tuple of the time the message was received and the message frame 228 /// Returns a tuple of the time the message was received and the message frame
@@ -417,7 +417,7 @@ impl<'c, 'd, T: Instance> CanTx<'c, 'd, T> {
417 self.tx.transmit(frame).map_err(|_| TryWriteError::Full) 417 self.tx.transmit(frame).map_err(|_| TryWriteError::Full)
418 } 418 }
419 419
420 pub async fn _flush(mb: bxcan::Mailbox) { 420 async fn flush_inner(mb: bxcan::Mailbox) {
421 poll_fn(|cx| { 421 poll_fn(|cx| {
422 T::state().tx_waker.register(cx.waker()); 422 T::state().tx_waker.register(cx.waker());
423 if T::regs().tsr().read().tme(mb.index()) { 423 if T::regs().tsr().read().tme(mb.index()) {
@@ -431,11 +431,10 @@ impl<'c, 'd, T: Instance> CanTx<'c, 'd, T> {
431 431
432 /// Waits for a specific transmit mailbox to become empty 432 /// Waits for a specific transmit mailbox to become empty
433 pub async fn flush(&self, mb: bxcan::Mailbox) { 433 pub async fn flush(&self, mb: bxcan::Mailbox) {
434 Self::_flush(mb).await 434 Self::flush_inner(mb).await
435 } 435 }
436 436
437 /// Waits until any of the transmit mailboxes become empty 437 async fn flush_any_inner() {
438 pub async fn _flush_any() {
439 poll_fn(|cx| { 438 poll_fn(|cx| {
440 T::state().tx_waker.register(cx.waker()); 439 T::state().tx_waker.register(cx.waker());
441 440
@@ -454,11 +453,10 @@ impl<'c, 'd, T: Instance> CanTx<'c, 'd, T> {
454 453
455 /// Waits until any of the transmit mailboxes become empty 454 /// Waits until any of the transmit mailboxes become empty
456 pub async fn flush_any(&self) { 455 pub async fn flush_any(&self) {
457 Self::_flush_any().await 456 Self::flush_any_inner().await
458 } 457 }
459 458
460 /// Waits until all of the transmit mailboxes become empty 459 async fn flush_all_inner() {
461 pub async fn _flush_all() {
462 poll_fn(|cx| { 460 poll_fn(|cx| {
463 T::state().tx_waker.register(cx.waker()); 461 T::state().tx_waker.register(cx.waker());
464 462
@@ -479,7 +477,7 @@ impl<'c, 'd, T: Instance> CanTx<'c, 'd, T> {
479 477
480 /// Waits until all of the transmit mailboxes become empty 478 /// Waits until all of the transmit mailboxes become empty
481 pub async fn flush_all(&self) { 479 pub async fn flush_all(&self) {
482 Self::_flush_all().await 480 Self::flush_all_inner().await
483 } 481 }
484} 482}
485 483