mimxrt/machine_uart: Fix a bug in UART.write().

Causing an incomplete send if the data size was longer than the buffer
size.
This commit is contained in:
robert-hh 2022-09-08 14:24:32 +02:00 committed by Damien George
parent 443fbcf81c
commit 6472348c1b
1 changed files with 1 additions and 1 deletions

View File

@ -395,7 +395,7 @@ STATIC mp_uint_t machine_uart_write(mp_obj_t self_in, const void *buf_in, mp_uin
// Wait at least the number of character times for this chunk.
t = ticks_us64() + (uint64_t)xfer.dataSize * (13000000 / self->config.baudRate_Bps + 1000);
while (self->handle.txDataSize) {
while (self->tx_status != kStatus_LPUART_TxIdle) {
// Wait for the first/next character to be sent.
if (ticks_us64() > t) { // timed out
if (self->handle.txDataSize >= size) {