Skip to content

Commit 8bb1a24

Browse files
authored
Fixes UartAvailableForWrite #9319
1 parent bcc9ece commit 8bb1a24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/esp32/esp32-hal-uart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ uint32_t uartAvailableForWrite(uart_t* uart)
578578
uint32_t available = uart_ll_get_txfifo_len(UART_LL_GET_HW(uart->num));
579579
size_t txRingBufferAvailable = 0;
580580
if (ESP_OK == uart_get_tx_buffer_free_size(uart->num, &txRingBufferAvailable)) {
581-
available += txRingBufferAvailable;
581+
available = txRingBufferAvailable == 0 ? available : txRingBufferAvailable;
582582
}
583583
UART_MUTEX_UNLOCK();
584584
return available;

0 commit comments

Comments
 (0)