We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcc9ece commit 8bb1a24Copy full SHA for 8bb1a24
cores/esp32/esp32-hal-uart.c
@@ -578,7 +578,7 @@ uint32_t uartAvailableForWrite(uart_t* uart)
578
uint32_t available = uart_ll_get_txfifo_len(UART_LL_GET_HW(uart->num));
579
size_t txRingBufferAvailable = 0;
580
if (ESP_OK == uart_get_tx_buffer_free_size(uart->num, &txRingBufferAvailable)) {
581
- available += txRingBufferAvailable;
+ available = txRingBufferAvailable == 0 ? available : txRingBufferAvailable;
582
}
583
UART_MUTEX_UNLOCK();
584
return available;
0 commit comments