From eab88f51e7a1167a7206f4da06d0b8622ecffd32 Mon Sep 17 00:00:00 2001 From: houwenxiang Date: Tue, 17 Mar 2020 13:24:42 +0800 Subject: [PATCH] driver(GPIO): fixed gpio_wake_up_disable not working for RTC IO (release/3.3) --- components/driver/gpio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/driver/gpio.c b/components/driver/gpio.c index fc365c44a7..d4651e0c68 100644 --- a/components/driver/gpio.c +++ b/components/driver/gpio.c @@ -491,8 +491,13 @@ esp_err_t gpio_wakeup_enable(gpio_num_t gpio_num, gpio_int_type_t intr_type) esp_err_t gpio_wakeup_disable(gpio_num_t gpio_num) { GPIO_CHECK(GPIO_IS_VALID_GPIO(gpio_num), "GPIO number error", ESP_ERR_INVALID_ARG); - GPIO.pin[gpio_num].wakeup_enable = 0; - return ESP_OK; + esp_err_t ret = ESP_OK; + if (RTC_GPIO_IS_VALID_GPIO(gpio_num)) { + ret = rtc_gpio_wakeup_disable(gpio_num); + } else { + GPIO.pin[gpio_num].wakeup_enable = 0; + } + return ret; } esp_err_t gpio_set_drive_capability(gpio_num_t gpio_num, gpio_drive_cap_t strength)