Skip to content

Commit

Permalink
Merge branch 'bugfix/esp32c3_deep_sleep_gpio_wakeup_issue' into 'master'
Browse files Browse the repository at this point in the history
deep sleep: fix sleep gpio wakeup fail issue

Closes WIFI-3474

See merge request espressif/esp-idf!13074
  • Loading branch information
jack0c committed Apr 14, 2021
2 parents ec01a66 + 2c2ae5a commit 1f54d17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/driver/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,9 @@ 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 SOC_GPIO_SUPPORT_SLP_SWITCH && CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND
gpio_hal_sleep_sel_en(gpio_context.gpio_hal, gpio_num);
#endif
portEXIT_CRITICAL(&gpio_context.gpio_spinlock);
return ret;
}
Expand Down Expand Up @@ -907,6 +910,9 @@ 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 SOC_GPIO_SUPPORT_SLP_SWITCH && CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND
gpio_hal_sleep_sel_dis(gpio_context.gpio_hal, gpio_num);
#endif
portEXIT_CRITICAL(&gpio_context.gpio_spinlock);
return ESP_OK;
}
Expand All @@ -919,6 +925,9 @@ 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 SOC_GPIO_SUPPORT_SLP_SWITCH && CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND
gpio_hal_sleep_sel_en(gpio_context.gpio_hal, gpio_num);
#endif
portEXIT_CRITICAL(&gpio_context.gpio_spinlock);
return ESP_OK;
}
Expand Down

0 comments on commit 1f54d17

Please sign in to comment.