mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(esp_hw_support): fix esp_sleep_enable_gpio_wakeup_on_hp_periph_powerdown bad logic
This commit is contained in:
@@ -1465,6 +1465,10 @@ esp_err_t esp_sleep_disable_wakeup_source(esp_sleep_source_t source)
|
||||
s_config.wakeup_triggers &= ~RTC_TOUCH_TRIG_EN;
|
||||
#endif
|
||||
} else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_GPIO, RTC_GPIO_TRIG_EN)) {
|
||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||
s_config.gpio_wakeup_mask = 0;
|
||||
s_config.gpio_trigger_mode = 0;
|
||||
#endif
|
||||
s_config.wakeup_triggers &= ~RTC_GPIO_TRIG_EN;
|
||||
} else if (CHECK_SOURCE(source, ESP_SLEEP_WAKEUP_UART, (RTC_UART0_TRIG_EN | RTC_UART1_TRIG_EN))) {
|
||||
s_config.wakeup_triggers &= ~(RTC_UART0_TRIG_EN | RTC_UART1_TRIG_EN);
|
||||
@@ -1878,12 +1882,12 @@ esp_err_t esp_deep_sleep_enable_gpio_wakeup(uint64_t gpio_pin_mask, esp_deepslee
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
err = gpio_deep_sleep_wakeup_enable(gpio_idx, intr_type);
|
||||
|
||||
if (err != ESP_OK) return err;
|
||||
s_config.gpio_wakeup_mask |= BIT(gpio_idx);
|
||||
if (mode == ESP_GPIO_WAKEUP_GPIO_HIGH) {
|
||||
s_config.gpio_trigger_mode |= (mode << gpio_idx);
|
||||
s_config.gpio_trigger_mode |= BIT(gpio_idx);
|
||||
} else {
|
||||
s_config.gpio_trigger_mode &= ~(mode << gpio_idx);
|
||||
s_config.gpio_trigger_mode &= ~BIT(gpio_idx);
|
||||
}
|
||||
}
|
||||
s_config.wakeup_triggers |= RTC_GPIO_TRIG_EN;
|
||||
|
||||
Reference in New Issue
Block a user