Skip to content

Commit fb8f124

Browse files
committed
wrong count checked for uartWrite
1 parent 38513ed commit fb8f124

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp32/esp32-hal-uart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void uartWrite(uart_t* uart, uint8_t c)
250250
return;
251251
}
252252
UART_MUTEX_LOCK();
253-
while(uart->dev->status.rxfifo_cnt == 0x7F);
253+
while(uart->dev->status.txfifo_cnt == 0x7F);
254254
uart->dev->fifo.rw_byte = c;
255255
UART_MUTEX_UNLOCK();
256256
}
@@ -262,7 +262,7 @@ void uartWriteBuf(uart_t* uart, const uint8_t * data, size_t len)
262262
}
263263
UART_MUTEX_LOCK();
264264
while(len) {
265-
while(len && uart->dev->status.rxfifo_cnt < 0x7F) {
265+
while(len && uart->dev->status.txfifo_cnt < 0x7F) {
266266
uart->dev->fifo.rw_byte = *data++;
267267
len--;
268268
}

0 commit comments

Comments
 (0)