From 52cd954e417908a2528d9c5665b5d70f3ee19f88 Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Thu, 13 Mar 2025 19:10:21 +0800 Subject: [PATCH] fix(sleep): uart suspend/flush should also check if port is enabled on esp32 --- components/esp_hw_support/sleep_modes.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 42e2b0f1e5..f511d67f4f 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -543,13 +543,9 @@ static void IRAM_ATTR resume_timers(uint32_t pd_flags) { static void IRAM_ATTR flush_uarts(void) { for (int i = 0; i < SOC_UART_HP_NUM; ++i) { -#ifdef CONFIG_IDF_TARGET_ESP32 - esp_rom_output_tx_wait_idle(i); -#else if (uart_ll_is_enabled(i)) { esp_rom_output_tx_wait_idle(i); } -#endif } } @@ -563,11 +559,9 @@ FORCE_INLINE_ATTR void suspend_uarts(void) { s_suspended_uarts_bmap = 0; for (int i = 0; i < SOC_UART_HP_NUM; ++i) { -#ifndef CONFIG_IDF_TARGET_ESP32 if (!uart_ll_is_enabled(i)) { continue; } -#endif uart_ll_force_xoff(i); s_suspended_uarts_bmap |= BIT(i); #if SOC_UART_SUPPORT_FSM_TX_WAIT_SEND