summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriabdalkader <i.abdalkader@gmail.com>2021-12-10 01:27:45 +0200
committerDamien George <damien@micropython.org>2021-12-14 14:59:39 +1100
commitf21c5655835ba3703deeb1f0fa375d6a706b03cc (patch)
treea2334ac2cec5803a534bd3a8be74f686b05ee565
parent5adb1fa40e95d938a713a3ed9a3b80615edf90fa (diff)
rp2/machine_uart: Handle and clear UART RX timeout IRQ.
The pico-sdk 1.3.0 update in 97a7cc243b028833bdcb8ce0bc19b2bce7545851 introduced a change that broke RP2 Bluetooth UART, and possibly UART in general, which stops working right after UART is initialized. The commit raspberrypi/pico-sdk@2622e9b enables the UART receive timeout (RTIM) IRQ, which is asserted when the receive FIFO is not empty, and no more characters are received for a period of time. This commit makes sure the RTIM IRQ is handled and cleared in uart_service_interrupt.
-rw-r--r--ports/rp2/machine_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/rp2/machine_uart.c b/ports/rp2/machine_uart.c
index a8ec149f4..887954276 100644
--- a/ports/rp2/machine_uart.c
+++ b/ports/rp2/machine_uart.c
@@ -126,7 +126,7 @@ STATIC void uart_fill_tx_fifo(machine_uart_obj_t *self) {
}
STATIC inline void uart_service_interrupt(machine_uart_obj_t *self) {
- if (uart_get_hw(self->uart)->mis & UART_UARTMIS_RXMIS_BITS) { // rx interrupt?
+ if (uart_get_hw(self->uart)->mis & (UART_UARTMIS_RXMIS_BITS | UART_UARTMIS_RTMIS_BITS)) { // rx interrupt?
// clear all interrupt bits but tx
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & (~UART_UARTICR_TXIC_BITS);
if (!self->read_lock) {