From 7c68678ddc51650495987b81aa65eef116c0dea7 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Thu, 16 Nov 2023 13:36:14 +0800 Subject: [PATCH] fix(esp_hw_support): clear all type ULP wakeup intr status at ulp wakeup source enable --- components/esp_hw_support/sleep_modes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 0efbcc3b76..5fc3da93d4 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -447,14 +447,18 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags) #if CONFIG_ULP_COPROC_ENABLED // Enable ULP wakeup +#if CONFIG_ESP32S3_ULP_COPROC_RISCV + if (s_config.wakeup_triggers & (RTC_COCPU_TRIG_EN | RTC_COCPU_TRAP_TRIG_EN)) { +#else if (s_config.wakeup_triggers & RTC_ULP_TRIG_EN) { +#endif #ifdef CONFIG_IDF_TARGET_ESP32 rtc_hal_ulp_wakeup_enable(); #else rtc_hal_ulp_int_clear(); #endif } -#endif +#endif // CONFIG_ULP_COPROC_ENABLED misc_modules_sleep_prepare(deep_sleep);