mirror of
https://github.com/micropython/micropython.git
synced 2026-06-11 17:15:16 +02:00
samd/machine_uart: Only fire the TXIDLE event once.
The UART DRE flag is always set if the DATA register is empty. That would lead to a TXIDLE event each time the IRQ handler was run. To fix that, only fire the TXIDLE event if the DRE interrupt flag is enabled. Partially fixes the `tests/extmod/machine_uart_irq_txidle.py` test on `ADAFRUIT_ITSYBITSY_M0_EXPRESS`. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -167,7 +167,7 @@ void common_uart_irq_handler(int uart_id) {
|
||||
uart->USART.DATA.bit.DATA =
|
||||
ringbuf_get(&self->write_buffer) | (ringbuf_get(&self->write_buffer) << 8);
|
||||
}
|
||||
} else {
|
||||
} else if (uart->USART.INTENCLR.bit.DRE != 0) {
|
||||
#if MICROPY_PY_MACHINE_UART_IRQ
|
||||
// Set the TXIDLE flag
|
||||
mp_irq_flags |= SERCOM_USART_INTFLAG_TXC;
|
||||
|
||||
Reference in New Issue
Block a user