feat(pm): add internal pull-up/downs option for gpio used for deepsleep wakeup

stash
This commit is contained in:
Lou Tianhao
2023-09-14 15:42:35 +08:00
parent a5caa1c724
commit 88364b8b11
3 changed files with 15 additions and 3 deletions

View File

@@ -1531,6 +1531,7 @@ static void gpio_deep_sleep_wakeup_prepare(void)
if (((1ULL << gpio_idx) & s_config.gpio_wakeup_mask) == 0) {
continue;
}
#if CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS
if (s_config.gpio_trigger_mode & BIT(gpio_idx)) {
ESP_ERROR_CHECK(gpio_pullup_dis(gpio_idx));
ESP_ERROR_CHECK(gpio_pulldown_en(gpio_idx));
@@ -1538,6 +1539,7 @@ static void gpio_deep_sleep_wakeup_prepare(void)
ESP_ERROR_CHECK(gpio_pullup_en(gpio_idx));
ESP_ERROR_CHECK(gpio_pulldown_dis(gpio_idx));
}
#endif
ESP_ERROR_CHECK(gpio_hold_en(gpio_idx));
}
// Clear state from previous wakeup