kopia lustrzana https://github.com/micropython/micropython
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 <maarten@thingsconnected.nl>pull/11847/head
rodzic
c3ca3612d1
commit
057701a770
|
@ -194,7 +194,7 @@ STATIC inline void uart_service_interrupt(machine_uart_obj_t *self) {
|
|||
}
|
||||
if (uart_get_hw(self->uart)->mis & UART_UARTMIS_TXMIS_BITS) { // tx interrupt?
|
||||
// clear all interrupt bits but rx
|
||||
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & (~UART_UARTICR_RXIC_BITS);
|
||||
uart_get_hw(self->uart)->icr = UART_UARTICR_BITS & ~(UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS);
|
||||
uart_fill_tx_fifo(self);
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue