From 5458df0a5435db0914d24770865a93e6d35bdab3 Mon Sep 17 00:00:00 2001 From: Rodrigo Garcia <65977697+SuGlider@users.noreply.github.com> Date: Wed, 21 Jul 2021 11:02:06 -0300 Subject: [PATCH] Fixes Serial.end() hanging on ESP32-S2 (#5434) Fixes: #5429 --- cores/esp32/esp32-hal-uart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index 19c80e5f..f670550e 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -164,7 +164,9 @@ static void uartEnableInterrupt(uart_t* uart, uint8_t rxfifo_full_thrhd) static void uartDisableInterrupt(uart_t* uart) { UART_MUTEX_LOCK(); +#if CONFIG_IDF_TARGET_ESP32 uart->dev->conf1.val = 0; +#endif uart->dev->int_ena.val = 0; uart->dev->int_clr.val = 0xffffffff;