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

Causing an incomplete send if the data size was longer than the buffer
size.
pull/9303/head
robert-hh 2022-09-08 14:24:32 +02:00 zatwierdzone przez Damien George
rodzic 443fbcf81c
commit 6472348c1b
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

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