Merge branch 'fix/lp_uart_flush_wait_for_idle' into 'master'

fix(lp_uart): Update the `lp_core_uart_tx_flush()` API to wait for UART Tx idle state

Closes IDFGH-14693

See merge request espressif/esp-idf!37401
This commit is contained in:
Sudeep Mohanty 2025-03-04 15:50:26 +08:00
commit 47df2ed524

View File

@ -68,9 +68,9 @@ void lp_core_uart_tx_flush(uart_port_t lp_uart_num)
(void)lp_uart_num; (void)lp_uart_num;
int loop_cnt = 0; int loop_cnt = 0;
if (uart_ll_is_enabled(LP_UART_NUM_0) && !uart_hal_is_tx_idle(&hal)) { if (uart_ll_is_enabled(LP_UART_NUM_0)) {
/* Wait for the Tx FIFO to be empty */ /* Wait for the Tx FIFO to be empty */
while (!(uart_hal_get_intraw_mask(&hal) & (LP_UART_TX_INT_FLAG | LP_UART_ERR_INT_FLAG))) { while (!(uart_hal_get_intraw_mask(&hal) & (LP_UART_TX_INT_FLAG | LP_UART_ERR_INT_FLAG) && uart_hal_is_tx_idle(&hal))) {
loop_cnt++; loop_cnt++;
if (loop_cnt > 10000) { if (loop_cnt > 10000) {
/* Bail out */ /* Bail out */