This is an automated email from the ASF dual-hosted git repository. jerpelea pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push: new 94f210ded6 arch/risc-v/espressif: Remove usb serial workaround for esp32 modules 94f210ded6 is described below commit 94f210ded60b83d115774434f9a3b0d9b1a3065e Author: Felipe Moura <moura....@gmail.com> AuthorDate: Sat Mar 1 16:32:19 2025 -0300 arch/risc-v/espressif: Remove usb serial workaround for esp32 modules This commit includes a change to the esp_txint function in the arch/risc-v/src/common/espressif/esp_usbserial.c file. The change primarily involves removing an optimization workaround and adding a call to flush the transmit FIFO. After this change the usbserial config is able to work using all optimization levels. Changes in esp_txint function: Removed the __attribute__((optimize("O0"))) workaround. Added a call to usb_serial_jtag_ll_txfifo_flush() at the beginning of the function. Signed-off-by: Felipe Moura <moura....@gmail.com> --- arch/risc-v/src/common/espressif/esp_usbserial.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/risc-v/src/common/espressif/esp_usbserial.c b/arch/risc-v/src/common/espressif/esp_usbserial.c index b64136e3da..f591ea3f39 100644 --- a/arch/risc-v/src/common/espressif/esp_usbserial.c +++ b/arch/risc-v/src/common/espressif/esp_usbserial.c @@ -216,14 +216,10 @@ static void esp_shutdown(struct uart_dev_s *dev) * ****************************************************************************/ -/* Workaround: This function does not work when optimization is different - * from O0. This modification will be removed once a final solution is - * implemented. - */ - -__attribute__((optimize("O0"))) static void esp_txint(struct uart_dev_s *dev, bool enable) { + usb_serial_jtag_ll_txfifo_flush(); + if (enable) { usb_serial_jtag_ll_ena_intr_mask(