diff options
| author | robert-hh <robert@hammelrath.com> | 2022-08-18 11:36:08 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-09-13 18:35:48 +1000 |
| commit | 443fbcf81c05de00f35b90d8a443837d62073a63 (patch) | |
| tree | 9db0716cadada8e6e878dd8fe12a01c6fea8aed6 | |
| parent | 0f048a5a2a4cb239784cd152c9cd3fa0deb86db7 (diff) | |
mimxrt/machine_uart: Set the UART ioctl write poll flag properly.
It was always set to True. The change adds a check to the tx status flag
which is set when all data is transferred.
| -rw-r--r-- | ports/mimxrt/machine_uart.c | 2 |
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) { |
