https://docs.espressif.com/projects/esp ... art_port_t
So my guess is that uart_flush() discards all content in TX ring buffer in main memory. What happens to the content of the 16-byte UART hardware TX buffer? Discarded as well?esp_err_t uart_flush(uart_port_t uart_num)
Alias of uart_flush_input. UART ring buffer flush. This will discard all data in the UART RX buffer.
Note
Instead of waiting the data sent out, this function will clear UART rx buffer. In order to send all the data in tx FIFO, we can use uart_wait_tx_done function.
Return
ESP_OK Success
ESP_FAIL Parameter error
Parameters
uart_num: UART_NUM_0, UART_NUM_1 or UART_NUM_2
esp_err_t uart_flush_input(uart_port_t uart_num)
Clear input buffer, discard all the data is in the ring-buffer.
Note
In order to send all the data in tx FIFO, we can use uart_wait_tx_done function.
Return
ESP_OK Success
ESP_FAIL Parameter error
Parameters
uart_num: UART_NUM_0, UART_NUM_1 or UART_NUM_2
My next guess is that uart_flush_input() discards all content in the RX ring buffer in main memory. What happens to the content in the 16-byte hardware RX buffer? Discarded as well?
Thank you!