From 464d278f8a93ae0660df7a532bc8a647d2fa6d63 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 20 Jul 2023 17:48:38 +0200 Subject: [PATCH] fix(esp_hw_support): fix build with CONFIG_ESP_CONSOLE_UART=n on C6 Closes https://github.com/espressif/esp-idf/issues/11924 --- components/esp_hw_support/sleep_modes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 6a7a12bb13..2d066877b7 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -488,12 +488,12 @@ FORCE_INLINE_ATTR void resume_uarts(void) FORCE_INLINE_ATTR bool light_sleep_uart_prepare(uint32_t pd_flags, int64_t sleep_duration) { bool should_skip_sleep = false; -#if !SOC_PM_SUPPORT_TOP_PD +#if !SOC_PM_SUPPORT_TOP_PD || !CONFIG_ESP_CONSOLE_UART suspend_uarts(); #else if (pd_flags & PMU_SLEEP_PD_TOP) { if ((s_config.wakeup_triggers & RTC_TIMER_TRIG_EN) && - // +1 is for cover the last charactor flush time + // +1 is for cover the last character flush time (sleep_duration < (int64_t)((UART_LL_FIFO_DEF_LEN - uart_ll_get_txfifo_len(CONSOLE_UART_DEV) + 1) * UART_FLUSH_US_PER_CHAR) + SLEEP_UART_FLUSH_DONE_TO_SLEEP_US)) { should_skip_sleep = true; } else {