diff options
Diffstat (limited to 'tests/rp/src/bin/uart_buffered.rs')
| -rw-r--r-- | tests/rp/src/bin/uart_buffered.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/rp/src/bin/uart_buffered.rs b/tests/rp/src/bin/uart_buffered.rs index 6ab7de29e..6a9c910ff 100644 --- a/tests/rp/src/bin/uart_buffered.rs +++ b/tests/rp/src/bin/uart_buffered.rs | |||
| @@ -9,7 +9,7 @@ use embassy_rp::bind_interrupts; | |||
| 9 | use embassy_rp::gpio::{Level, Output}; | 9 | use embassy_rp::gpio::{Level, Output}; |
| 10 | use embassy_rp::peripherals::UART0; | 10 | use embassy_rp::peripherals::UART0; |
| 11 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config, Error, Instance, Parity}; | 11 | use embassy_rp::uart::{BufferedInterruptHandler, BufferedUart, BufferedUartRx, Config, Error, Instance, Parity}; |
| 12 | use embassy_time::{Duration, Timer}; | 12 | use embassy_time::Timer; |
| 13 | use embedded_io_async::{Read, ReadExactError, Write}; | 13 | use embedded_io_async::{Read, ReadExactError, Write}; |
| 14 | use {defmt_rtt as _, panic_probe as _}; | 14 | use {defmt_rtt as _, panic_probe as _}; |
| 15 | 15 | ||
| @@ -39,14 +39,14 @@ async fn read1<const N: usize>(uart: &mut BufferedUartRx<'_, impl Instance>) -> | |||
| 39 | 39 | ||
| 40 | async fn send(pin: &mut Output<'_, impl embassy_rp::gpio::Pin>, v: u8, parity: Option<bool>) { | 40 | async fn send(pin: &mut Output<'_, impl embassy_rp::gpio::Pin>, v: u8, parity: Option<bool>) { |
| 41 | pin.set_low(); | 41 | pin.set_low(); |
| 42 | Timer::after(Duration::from_millis(1)).await; | 42 | Timer::after_millis(1).await; |
| 43 | for i in 0..8 { | 43 | for i in 0..8 { |
| 44 | if v & (1 << i) == 0 { | 44 | if v & (1 << i) == 0 { |
| 45 | pin.set_low(); | 45 | pin.set_low(); |
| 46 | } else { | 46 | } else { |
| 47 | pin.set_high(); | 47 | pin.set_high(); |
| 48 | } | 48 | } |
| 49 | Timer::after(Duration::from_millis(1)).await; | 49 | Timer::after_millis(1).await; |
| 50 | } | 50 | } |
| 51 | if let Some(b) = parity { | 51 | if let Some(b) = parity { |
| 52 | if b { | 52 | if b { |
| @@ -54,10 +54,10 @@ async fn send(pin: &mut Output<'_, impl embassy_rp::gpio::Pin>, v: u8, parity: O | |||
| 54 | } else { | 54 | } else { |
| 55 | pin.set_low(); | 55 | pin.set_low(); |
| 56 | } | 56 | } |
| 57 | Timer::after(Duration::from_millis(1)).await; | 57 | Timer::after_millis(1).await; |
| 58 | } | 58 | } |
| 59 | pin.set_high(); | 59 | pin.set_high(); |
| 60 | Timer::after(Duration::from_millis(1)).await; | 60 | Timer::after_millis(1).await; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | #[embassy_executor::main] | 63 | #[embassy_executor::main] |
