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 <erik.englund@gmail.com>
This commit is contained in:
Erik Englund 2026-09-28 22:10:13 +02:00 • committed by Xiang Xiao
parent fe7eff404e
commit 5dd13b578d

View file

@ -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);