This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 5dd13b578d35892b677e3933b1dc450f0cc349da
Author: Erik Englund <[email protected]>
AuthorDate: Mon Sep 28 22:10:13 2026 +0200

    arch/risc-v/espressif: Fix dangling else in esp_setup() for RS-485.
    
    The RS-485 tx_idle_num block in esp_setup() ends in a bare "else" that
    binds to the next statement, which is now leave_critical_section().  On
    an RS-485 port esp_setup() therefore returns with interrupts disabled.
    
    uart_open() hides this behind its own critical section, but a
    tcsetattr() that changes the line settings calls esp_setup() through
    TCSETS and leaves the calling task running with interrupts off.  On an
    ESP32-C3 the system tick stops advancing in that task.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: Erik Englund <[email protected]>
---
 arch/risc-v/src/common/espressif/esp_serial.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/risc-v/src/common/espressif/esp_serial.c 
b/arch/risc-v/src/common/espressif/esp_serial.c
index 8c29b8d16a6..84003b92e6f 100644
--- a/arch/risc-v/src/common/espressif/esp_serial.c
+++ b/arch/risc-v/src/common/espressif/esp_serial.c
@@ -579,7 +579,6 @@ static int esp_setup(uart_dev_t *dev)
     {
       uart_hal_set_tx_idle_num(priv->hal, 1);
     }
-  else
 #endif
 
   leave_critical_section(flags);

Reply via email to