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.
pull/9303/head
robert-hh 2022-08-18 11:36:08 +02:00 zatwierdzone przez Damien George
rodzic 0f048a5a2a
commit 443fbcf81c
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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) {