Skip to content

Commit 057701a

Browse files
mvds00dpgeorge
authored andcommitted
rp2/machine_uart: Fix potential race condition in interrupt handling.
The irq service routine cleared the RT interrupt bit on TX interrupt. This opens the possibility that an RT interrupt is missed. Signed-off-by: Maarten van der Schrieck <[email protected]>
1 parent c3ca361 commit 057701a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/rp2/machine_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ STATIC inline void uart_service_interrupt(machine_uart_obj_t *self) {
194194
}
195195
if (uart_get_hw(self->uart)->mis & UART_UARTMIS_TXMIS_BITS) { // tx interrupt?
196196
// clear all interrupt bits but rx
197-
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & (~UART_UARTICR_RXIC_BITS);
197+
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & ~(UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS);
198198
uart_fill_tx_fifo(self);
199199
}
200200
}

0 commit comments

Comments
 (0)