Browse Source

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 2 years ago
committed by Damien George
parent
commit
6472348c1b
  1. 2
      ports/mimxrt/machine_uart.c

2
ports/mimxrt/machine_uart.c

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

Loading…
Cancel
Save