fix(uart): correct uart_get_tx_buffer_free_size calculation

Modified a bit on the TX ring buffer push size logic

 Closes https://github.com/espressif/esp-idf/issues/15859
This commit is contained in:
Song Ruo Jing
2025-10-17 16:09:26 +08:00
parent fb20e147d5
commit 9629b2fb6a
3 changed files with 158 additions and 30 deletions
@@ -605,7 +605,9 @@ esp_err_t uart_flush_input(uart_port_t uart_num);
esp_err_t uart_get_buffered_data_len(uart_port_t uart_num, size_t* size);
/**
* @brief UART get TX ring buffer free space size
* @brief UART get TX ring buffer free space size for the next data to be enqueued
*
* It returns the tight conservative bound for NOSPLIT ring buffer overall enqueueable payload across up to two chunks.
*
* @param uart_num UART port number, the max port number is (UART_NUM_MAX -1).
* @param size Pointer of size_t to accept the free space size