diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/uart_interrupt.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/uart_interrupt.rs b/examples/uart_interrupt.rs index b309ce973..85743bb64 100644 --- a/examples/uart_interrupt.rs +++ b/examples/uart_interrupt.rs | |||
| @@ -45,9 +45,11 @@ async fn main(_spawner: Spawner) { | |||
| 45 | // Configure LPUART2 interrupt for UART operation BEFORE any UART usage | 45 | // Configure LPUART2 interrupt for UART operation BEFORE any UART usage |
| 46 | hal::interrupt::LPUART2.configure_for_uart(hal::interrupt::Priority::from(3)); | 46 | hal::interrupt::LPUART2.configure_for_uart(hal::interrupt::Priority::from(3)); |
| 47 | 47 | ||
| 48 | // Manually install the interrupt handler | 48 | // Manually install the interrupt handler and enable RX IRQs in the peripheral |
| 49 | unsafe { | 49 | unsafe { |
| 50 | hal::interrupt::LPUART2.install_handler(lpuart2_handler); | 50 | hal::interrupt::LPUART2.install_handler(lpuart2_handler); |
| 51 | // Enable RX interrupts so the handler actually fires on incoming bytes | ||
| 52 | uart.enable_rx_interrupts(); | ||
| 51 | } | 53 | } |
| 52 | 54 | ||
| 53 | // Print welcome message | 55 | // Print welcome message |
