From 42aa4ee3d4997b0c881f298092d2416ab9f966c5 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Wed, 22 Jun 2022 10:20:39 +0800 Subject: [PATCH] ulp: only enable relevant wakeup sources for ULP Do not enable co-processor trap wakeup source when running ULP FSM, as this could cause spurious wake-ups. --- components/esp_hw_support/sleep_modes.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 7c43dbae55..fa478f5703 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -846,14 +846,17 @@ esp_err_t esp_sleep_enable_ulp_wakeup(void) ESP_LOGE(TAG, "Conflicting wake-up trigger: ext0"); return ESP_ERR_INVALID_STATE; } +#endif //CONFIG_IDF_TARGET_ESP32 + +#if CONFIG_ULP_COPROC_TYPE_FSM s_config.wakeup_triggers |= RTC_ULP_TRIG_EN; return ESP_OK; -#elif CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 - s_config.wakeup_triggers |= (RTC_ULP_TRIG_EN | RTC_COCPU_TRIG_EN | RTC_COCPU_TRAP_TRIG_EN); +#elif CONFIG_ULP_COPROC_TYPE_RISCV + s_config.wakeup_triggers |= (RTC_COCPU_TRIG_EN | RTC_COCPU_TRAP_TRIG_EN); return ESP_OK; #else return ESP_ERR_NOT_SUPPORTED; -#endif +#endif //CONFIG_ULP_COPROC_TYPE_FSM } esp_err_t esp_sleep_enable_timer_wakeup(uint64_t time_in_us)