diff options
| author | huntc <[email protected]> | 2021-12-10 12:08:00 +1100 |
|---|---|---|
| committer | huntc <[email protected]> | 2021-12-10 12:16:08 +1100 |
| commit | 7256ff3e71ceea9091349b040a2ebc987aca590c (patch) | |
| tree | 6f23c25b08c027db1dd133a7489b50661e08da7c /examples/nrf/src/bin/buffered_uart.rs | |
| parent | 60b7c50d8b02f92844287b150c5f504750846625 (diff) | |
Provides AsyncWrite with flush
As per Tokio and others, this commit provides a `poll_flush` method on `AsyncWrite` so that a best-effort attempt at wakening once all bytes are flushed can be made.
Diffstat (limited to 'examples/nrf/src/bin/buffered_uart.rs')
| -rw-r--r-- | examples/nrf/src/bin/buffered_uart.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/nrf/src/bin/buffered_uart.rs b/examples/nrf/src/bin/buffered_uart.rs index 5d9075edf..c3e07e44a 100644 --- a/examples/nrf/src/bin/buffered_uart.rs +++ b/examples/nrf/src/bin/buffered_uart.rs | |||
| @@ -61,5 +61,8 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 61 | info!("writing..."); | 61 | info!("writing..."); |
| 62 | unwrap!(u.write_all(&buf).await); | 62 | unwrap!(u.write_all(&buf).await); |
| 63 | info!("write done"); | 63 | info!("write done"); |
| 64 | |||
| 65 | // Wait until the bytes are actually finished being transmitted | ||
| 66 | unwrap!(u.flush().await); | ||
| 64 | } | 67 | } |
| 65 | } | 68 | } |
