From 1e89698c602db5a5d8427340dddf03d745a86882 Mon Sep 17 00:00:00 2001 From: hebinglin Date: Fri, 1 Aug 2025 16:55:22 +0800 Subject: [PATCH 1/2] fix(esp_hw_support): change esp_sleep_clock_option_t to fix idf-13119 --- .../esp_hw_support/include/esp_private/esp_sleep_internal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/esp_hw_support/include/esp_private/esp_sleep_internal.h b/components/esp_hw_support/include/esp_private/esp_sleep_internal.h index d66b739d8e..ec53ba31d8 100644 --- a/components/esp_hw_support/include/esp_private/esp_sleep_internal.h +++ b/components/esp_hw_support/include/esp_private/esp_sleep_internal.h @@ -110,7 +110,8 @@ typedef enum { */ typedef enum { ESP_SLEEP_CLOCK_OPTION_GATE, //!< Gate the clock in sleep mode - ESP_SLEEP_CLOCK_OPTION_UNGATE //!< Ungate the clock in sleep mode + ESP_SLEEP_CLOCK_OPTION_UNGATE, //!< Ungate the clock in sleep mode + ESP_SLEEP_CLOCK_OPTION_MAX } esp_sleep_clock_option_t; /** From 52ef5c80729b6a85c67bb38863f09abab7049539 Mon Sep 17 00:00:00 2001 From: hebinglin Date: Fri, 1 Aug 2025 17:08:05 +0800 Subject: [PATCH 2/2] fix(esp_hw_support): change if condition to fix idf-13103 --- components/esp_hw_support/sleep_modes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index cf90f79113..d5e99cb43e 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -2540,7 +2540,7 @@ int32_t* esp_sleep_sub_mode_dump_config(FILE *stream) { #if SOC_PM_SUPPORT_PMU_CLK_ICG esp_err_t esp_sleep_clock_config(esp_sleep_clock_t clock, esp_sleep_clock_option_t option) { - if (clock > ESP_SLEEP_CLOCK_MAX || option > ESP_SLEEP_CLOCK_OPTION_UNGATE) { + if (clock >= ESP_SLEEP_CLOCK_MAX || option >= ESP_SLEEP_CLOCK_OPTION_MAX) { return ESP_ERR_INVALID_ARG; }