driver(gpio): fix gpio can't wakeup light sleep

This commit is contained in:
fuzhibo
2020-04-27 20:30:23 +08:00
committed by bot
parent bd920d22b0
commit d91e64cea4
3 changed files with 8 additions and 14 deletions
-3
View File
@@ -1,6 +1,3 @@
| Supported Targets | ESP32 |
| ----------------- | ----- |
# Light Sleep Example
(See the README.md file in the upper level 'examples' directory for more information about examples.)
@@ -17,7 +17,6 @@
#include "esp_sleep.h"
#include "esp_log.h"
#include "driver/uart.h"
#include "driver/rtc_io.h"
/* Most development boards have "boot" button attached to GPIO0.
* You can also change this to another pin.
@@ -46,11 +45,11 @@ void app_main(void)
esp_sleep_enable_gpio_wakeup();
/* Wait until GPIO goes high */
if (rtc_gpio_get_level(button_gpio_num) == wakeup_level) {
if (gpio_get_level(button_gpio_num) == wakeup_level) {
printf("Waiting for GPIO%d to go high...\n", button_gpio_num);
do {
vTaskDelay(pdMS_TO_TICKS(10));
} while (rtc_gpio_get_level(button_gpio_num) == wakeup_level);
} while (gpio_get_level(button_gpio_num) == wakeup_level);
}
printf("Entering light sleep\n");