From 0f4bf3e0974e55dbb5ac4c27cc124543f20ac137 Mon Sep 17 00:00:00 2001 From: JiangGuangMing Date: Wed, 10 Jun 2026 10:45:57 +0800 Subject: [PATCH] fix(sleep): disable usb wakeup through generic API Co-authored-by: Cursor --- components/esp_hw_support/sleep_modes.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index d13f76abe0b..acc10a45878 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -1830,6 +1830,10 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source) #if SOC_VBAT_SUPPORTED } else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_VBAT_UNDER_VOLT, RTC_VBAT_UNDER_VOLT_TRIG_EN)) { s_config.wakeup_triggers &= ~RTC_VBAT_UNDER_VOLT_TRIG_EN; +#endif +#if SOC_PM_SUPPORT_USB_WAKEUP + } else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_USB, RTC_USB_TRIG_EN)) { + s_config.wakeup_triggers &= ~RTC_USB_TRIG_EN; #endif } else { ESP_EARLY_LOGE(TAG, "Incorrect wakeup source (%d) to disable.", (int) source);