diff options
| author | James Munns <[email protected]> | 2025-11-14 19:08:16 +0100 |
|---|---|---|
| committer | James Munns <[email protected]> | 2025-11-14 19:08:16 +0100 |
| commit | 1f589e9428542cd94bc630b623accf04d9c36edf (patch) | |
| tree | c63ec2d0ef51f0d432e00f7f51ea2275b0e88f67 /examples/src/bin/ostimer_async.rs | |
| parent | 0bae6aa5aaab5d0f3a3e7e1ec83a0cee909de115 (diff) | |
A little follow-up cleanup
Diffstat (limited to 'examples/src/bin/ostimer_async.rs')
| -rw-r--r-- | examples/src/bin/ostimer_async.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/src/bin/ostimer_async.rs b/examples/src/bin/ostimer_async.rs index 4e692a744..881f09374 100644 --- a/examples/src/bin/ostimer_async.rs +++ b/examples/src/bin/ostimer_async.rs | |||
| @@ -3,8 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | use embassy_executor::Spawner; | 4 | use embassy_executor::Spawner; |
| 5 | use embassy_mcxa::bind_interrupts; | 5 | use embassy_mcxa::bind_interrupts; |
| 6 | use embassy_mcxa_examples::init_uart2; | 6 | use embassy_mcxa_examples::init_uart2_pins; |
| 7 | use embassy_time::{Duration, Timer}; | 7 | use embassy_time::{Duration, Timer}; |
| 8 | use hal::lpuart::{Config, Lpuart}; | ||
| 8 | use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; | 9 | use {defmt_rtt as _, embassy_mcxa as hal, panic_probe as _}; |
| 9 | 10 | ||
| 10 | // Bind only OS_EVENT, and retain the symbol explicitly so it can’t be GC’ed. | 11 | // Bind only OS_EVENT, and retain the symbol explicitly so it can’t be GC’ed. |
| @@ -21,7 +22,7 @@ async fn main(_spawner: Spawner) { | |||
| 21 | let p = hal::init(hal::config::Config::default()); | 22 | let p = hal::init(hal::config::Config::default()); |
| 22 | 23 | ||
| 23 | // Create UART configuration | 24 | // Create UART configuration |
| 24 | let config = hal::lpuart::Config { | 25 | let config = Config { |
| 25 | baudrate_bps: 115_200, | 26 | baudrate_bps: 115_200, |
| 26 | enable_tx: true, | 27 | enable_tx: true, |
| 27 | enable_rx: true, | 28 | enable_rx: true, |
| @@ -30,9 +31,9 @@ async fn main(_spawner: Spawner) { | |||
| 30 | 31 | ||
| 31 | // Create UART instance using LPUART2 with PIO2_2 as TX and PIO2_3 as RX | 32 | // Create UART instance using LPUART2 with PIO2_2 as TX and PIO2_3 as RX |
| 32 | unsafe { | 33 | unsafe { |
| 33 | init_uart2(hal::pac()); | 34 | init_uart2_pins(hal::pac()); |
| 34 | } | 35 | } |
| 35 | let mut uart = hal::lpuart::Lpuart::new_blocking( | 36 | let mut uart = Lpuart::new_blocking( |
| 36 | p.LPUART2, // Peripheral | 37 | p.LPUART2, // Peripheral |
| 37 | p.PIO2_2, // TX pin | 38 | p.PIO2_2, // TX pin |
| 38 | p.PIO2_3, // RX pin | 39 | p.PIO2_3, // RX pin |
