10000 mimxrt: Fix a bug in uart.write(). · micropython/micropython@e435583 · GitHub
[go: up one dir, main page]

Skip to content

Commit e435583

Browse files
committed
mimxrt: Fix a bug in uart.write().
Causing an incomplete send if the data size was longer than the buffer size.
1 parent a77a47a commit e435583

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/mimxrt/machine_uart.c

Lines changed: 1 addition & 1 deletion
7902
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ STATIC mp_uint_t machine_uart_write(mp_obj_t self_in, const void *buf_in, mp_uin
396396

397397
// Wait at least the number of character times for this chunk.
398398
t = ticks_us64() + (uint64_t)xfer.dataSize * (13000000 / self->config.baudRate_Bps + 1000);
399-
while (self->handle.txDataSize) {
399+
while (self->tx_status != kStatus_LPUART_TxIdle) {
400400
// Wait for the first/next character to be sent.
401401
if (ticks_us64() > t) { // timed out
402402
if (self->handle.txDataSize >= size) {

0 commit comments

Comments
 (0)
0