Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 054e6b3

Browse files
authoredAug 8, 2022
Fixes HardwareSerial::availableForWrite + setTxBufferSize (#6998)
1 parent 860b104 commit 054e6b3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎cores/esp32/esp32-hal-uart.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ uint32_t uartAvailableForWrite(uart_t* uart)
238238
}
239239
UART_MUTEX_LOCK();
240240
uint32_t available = uart_ll_get_txfifo_len(UART_LL_GET_HW(uart->num));
241+
size_t txRingBufferAvailable = 0;
242+
if (ESP_OK == uart_get_tx_buffer_free_size(uart->num, &txRingBufferAvailable)) {
243+
available += txRingBufferAvailable;
244+
}
241245
UART_MUTEX_UNLOCK();
242246
return available;
243247
}

1 commit comments

Comments
 (1)

gt1485a commented on Aug 18, 2022

@gt1485a

I am trying to compile from master and this gives an "implicit declaration of function". I'm no c++ expert so it may be something on my end.

Please sign in to comment.