diff --git a/components/driver/gpio.c b/components/driver/gpio.c index 66077787f4..d886d32418 100644 --- a/components/driver/gpio.c +++ b/components/driver/gpio.c @@ -573,7 +573,7 @@ esp_err_t gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type) #endif portENTER_CRITICAL(&gpio_context.gpio_spinlock); gpio_hal_wakeup_enable(gpio_context.gpio_hal, gpio_num, intr_type); -#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND +#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO gpio_hal_sleep_sel_dis(gpio_context.gpio_hal, gpio_num); #endif portEXIT_CRITICAL(&gpio_context.gpio_spinlock); @@ -596,7 +596,7 @@ esp_err_t gpio_wakeup_disable(gpio_num_t gpio_num) #endif portENTER_CRITICAL(&gpio_context.gpio_spinlock); gpio_hal_wakeup_disable(gpio_context.gpio_hal, gpio_num); -#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND +#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO gpio_hal_sleep_sel_en(gpio_context.gpio_hal, gpio_num); #endif portEXIT_CRITICAL(&gpio_context.gpio_spinlock); @@ -919,7 +919,7 @@ esp_err_t gpio_deep_sleep_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t int } portENTER_CRITICAL(&gpio_context.gpio_spinlock); gpio_hal_deepsleep_wakeup_enable(gpio_context.gpio_hal, gpio_num, intr_type); -#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND +#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO gpio_hal_sleep_sel_dis(gpio_context.gpio_hal, gpio_num); #endif portEXIT_CRITICAL(&gpio_context.gpio_spinlock); @@ -934,7 +934,7 @@ esp_err_t gpio_deep_sleep_wakeup_disable(gpio_num_t gpio_num) } portENTER_CRITICAL(&gpio_context.gpio_spinlock); gpio_hal_deepsleep_wakeup_disable(gpio_context.gpio_hal, gpio_num); -#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND +#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO gpio_hal_sleep_sel_en(gpio_context.gpio_hal, gpio_num); #endif portEXIT_CRITICAL(&gpio_context.gpio_spinlock); diff --git a/components/esp_pm/pm_impl.c b/components/esp_pm/pm_impl.c index f3cf0c491a..9f5a98b4e3 100644 --- a/components/esp_pm/pm_impl.c +++ b/components/esp_pm/pm_impl.c @@ -301,10 +301,6 @@ esp_err_t esp_pm_configure(const void* vconfig) s_config_changed = true; portEXIT_CRITICAL(&s_switch_lock); -#if CONFIG_PM_SLP_DISABLE_GPIO - esp_sleep_enable_gpio_switch(config->light_sleep_enable); -#endif - #if CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU && SOC_PM_SUPPORT_CPU_PD esp_err_t ret = esp_sleep_cpu_pd_low_init(config->light_sleep_enable); if (config->light_sleep_enable && ret != ESP_OK) { @@ -726,9 +722,6 @@ void esp_pm_impl_init(void) esp_pm_trace_init(); #endif -#if CONFIG_PM_SLP_DISABLE_GPIO - esp_sleep_config_gpio_isolate(); -#endif ESP_ERROR_CHECK(esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "rtos0", &s_rtos_lock_handle[0])); ESP_ERROR_CHECK(esp_pm_lock_acquire(s_rtos_lock_handle[0])); diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 385c3f0db1..a2eca16c99 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -407,7 +407,7 @@ IRAM_ATTR ESP_SYSTEM_INIT_FN(init_components0, BIT(0)) { esp_timer_init(); -#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND && !CONFIG_PM_SLP_DISABLE_GPIO +#if CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND || CONFIG_PM_SLP_DISABLE_GPIO /* Configure to isolate (disable the Input/Output/Pullup/Pulldown * function of the pin) all GPIO pins in sleep state */