From be95a0c7007954fdf54b827abbbd5b5a5ca271b5 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 6 Nov 2024 17:04:04 +0900 Subject: [PATCH] esp32s3_serial.c: make up_putc take the critical section cf. https://github.com/apache/nuttx/issues/14662 --- arch/xtensa/src/esp32s3/esp32s3_serial.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/xtensa/src/esp32s3/esp32s3_serial.c b/arch/xtensa/src/esp32s3/esp32s3_serial.c index c83dc19f55f16..2055bfd966741 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_serial.c +++ b/arch/xtensa/src/esp32s3/esp32s3_serial.c @@ -1213,8 +1213,10 @@ void xtensa_serialinit(void) void up_putc(int ch) { #ifdef CONSOLE_UART + irqstate_t flags; uint32_t int_status; + flags = enter_critical_section(); esp32s3_lowputc_disable_all_uart_int(CONSOLE_DEV.priv, &int_status); #endif @@ -1222,6 +1224,7 @@ void up_putc(int ch) #ifdef CONSOLE_UART esp32s3_lowputc_restore_all_uart_int(CONSOLE_DEV.priv, &int_status); + leave_critical_section(flags); #endif } @@ -1240,8 +1243,10 @@ void up_putc(int ch) void up_putc(int ch) { #ifdef CONSOLE_UART + irqstate_t flags; uint32_t int_status; + flags = enter_critical_section(); esp32s3_lowputc_disable_all_uart_int(CONSOLE_DEV.priv, &int_status); #endif @@ -1249,6 +1254,7 @@ void up_putc(int ch) #ifdef CONSOLE_UART esp32s3_lowputc_restore_all_uart_int(CONSOLE_DEV.priv, &int_status); + leave_critical_section(flags); #endif }