summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/mimxrt/machine_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/mimxrt/machine_uart.c b/ports/mimxrt/machine_uart.c
index 1b0c06333..ab1788692 100644
--- a/ports/mimxrt/machine_uart.c
+++ b/ports/mimxrt/machine_uart.c
@@ -437,7 +437,7 @@ STATIC mp_uint_t machine_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint
ret |= MP_STREAM_POLL_RD;
}
}
- if ((flags & MP_STREAM_POLL_WR)) {
+ if ((flags & MP_STREAM_POLL_WR) && (self->tx_status == kStatus_LPUART_TxIdle)) {
ret |= MP_STREAM_POLL_WR;
}
} else if (request == MP_STREAM_FLUSH) {