From 1ef578caac16dbbb99d7736e40802dab453b0185 Mon Sep 17 00:00:00 2001 From: Abanoub Salah Date: Sun, 31 May 2026 09:17:39 +0300 Subject: [PATCH] uart: fix threshold configuration loss when interrupts are disabled --- components/esp_driver_uart/src/uart.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/esp_driver_uart/src/uart.c b/components/esp_driver_uart/src/uart.c index f10546a2375..13f367c02bb 100644 --- a/components/esp_driver_uart/src/uart.c +++ b/components/esp_driver_uart/src/uart.c @@ -2219,9 +2219,7 @@ esp_err_t uart_set_rx_full_threshold(uart_port_t uart_num, int threshold) return ESP_ERR_INVALID_STATE; } UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); - if (uart_hal_get_intr_ena_status(&(uart_context[uart_num].hal)) & UART_INTR_RXFIFO_FULL) { - uart_hal_set_rxfifo_full_thr(&(uart_context[uart_num].hal), threshold); - } + uart_hal_set_rxfifo_full_thr(&(uart_context[uart_num].hal), threshold); UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); return ESP_OK; } @@ -2236,9 +2234,7 @@ esp_err_t uart_set_tx_empty_threshold(uart_port_t uart_num, int threshold) return ESP_ERR_INVALID_STATE; } UART_ENTER_CRITICAL(&(uart_context[uart_num].spinlock)); - if (uart_hal_get_intr_ena_status(&(uart_context[uart_num].hal)) & UART_INTR_TXFIFO_EMPTY) { - uart_hal_set_txfifo_empty_thr(&(uart_context[uart_num].hal), threshold); - } + uart_hal_set_txfifo_empty_thr(&(uart_context[uart_num].hal), threshold); UART_EXIT_CRITICAL(&(uart_context[uart_num].spinlock)); return ESP_OK; }