diff options
Diffstat (limited to 'examples/nrf52840/src/bin/uart_split.rs')
| -rw-r--r-- | examples/nrf52840/src/bin/uart_split.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/nrf52840/src/bin/uart_split.rs b/examples/nrf52840/src/bin/uart_split.rs index c7510a9a8..d75143126 100644 --- a/examples/nrf52840/src/bin/uart_split.rs +++ b/examples/nrf52840/src/bin/uart_split.rs | |||
| @@ -13,7 +13,7 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 13 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); | 13 | static CHANNEL: Channel<ThreadModeRawMutex, [u8; 8], 1> = Channel::new(); |
| 14 | 14 | ||
| 15 | bind_interrupts!(struct Irqs { | 15 | bind_interrupts!(struct Irqs { |
| 16 | UARTE0_UART0 => uarte::InterruptHandler<UARTE0>; | 16 | UARTE0 => uarte::InterruptHandler<UARTE0>; |
| 17 | }); | 17 | }); |
| 18 | 18 | ||
| 19 | #[embassy_executor::main] | 19 | #[embassy_executor::main] |
| @@ -23,14 +23,14 @@ async fn main(spawner: Spawner) { | |||
| 23 | config.parity = uarte::Parity::EXCLUDED; | 23 | config.parity = uarte::Parity::EXCLUDED; |
| 24 | config.baudrate = uarte::Baudrate::BAUD115200; | 24 | config.baudrate = uarte::Baudrate::BAUD115200; |
| 25 | 25 | ||
| 26 | let uart = uarte::Uarte::new(p.UARTE0, Irqs, p.P0_08, p.P0_06, config); | 26 | let uart = uarte::Uarte::new(p.UARTE0, p.P0_08, p.P0_06, Irqs, config); |
| 27 | let (mut tx, rx) = uart.split(); | 27 | let (mut tx, rx) = uart.split(); |
| 28 | 28 | ||
| 29 | info!("uarte initialized!"); | 29 | info!("uarte initialized!"); |
| 30 | 30 | ||
| 31 | // Spawn a task responsible purely for reading | 31 | // Spawn a task responsible purely for reading |
| 32 | 32 | ||
| 33 | unwrap!(spawner.spawn(reader(rx))); | 33 | spawner.spawn(unwrap!(reader(rx))); |
| 34 | 34 | ||
| 35 | // Message must be in SRAM | 35 | // Message must be in SRAM |
| 36 | { | 36 | { |
| @@ -52,7 +52,7 @@ async fn main(spawner: Spawner) { | |||
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | #[embassy_executor::task] | 54 | #[embassy_executor::task] |
| 55 | async fn reader(mut rx: UarteRx<'static, UARTE0>) { | 55 | async fn reader(mut rx: UarteRx<'static>) { |
| 56 | let mut buf = [0; 8]; | 56 | let mut buf = [0; 8]; |
| 57 | loop { | 57 | loop { |
| 58 | info!("reading..."); | 58 | info!("reading..."); |
