ESP_ICY wrote: ↑Mon Dec 13, 2021 12:09 pm
1.首先确定一下你这边使用的唤醒方式,是 GPIO 电平唤醒还是 GPIO 中断唤醒,就是你使用的唤醒方式是esp_sleep_enable_gpio_wakeup 还是 esp_sleep_enable_ext0_wakeup ,根据你的描述,你提到 “表现现象为GPIO17没有中断”,所以是否想使用中断唤醒,但是 “wakeup_reason = "pin"” 这个在 example 中应该是使用了 GPIO 电平唤醒的。
2.可以尝试着在menuconfig → Component config → FreeRTOS中修改Tick rate (Hz)为1000
我前面已经提到
芯片:ESP32
IDF:V4.3
例程:light_sleep_example_main.c
然后我把
改成
Code: Select all
#define BUTTON_GPIO_NUM_DEFAULT 17
把
Code: Select all
#define BUTTON_WAKEUP_LEVEL_DEFAULT 0
改成
Code: Select all
#define BUTTON_WAKEUP_LEVEL_DEFAULT 1
把
Code: Select all
esp_sleep_enable_timer_wakeup(2000000);
改成
Code: Select all
esp_sleep_enable_timer_wakeup(10000000);
然后我的GPIO17一直为低电平,但是呼醒的reason为pin,调试如下
Code: Select all
Entering light sleep
Returned from light sleep, reason: pin, t=192621 ms, slept for 1623 ms
Entering light sleep
Returned from light sleep, reason: pin, t=194231 ms, slept for 1601 ms
Entering light sleep
Returned from light sleep, reason: pin, t=195836 ms, slept for 1597 ms
Entering light sleep
Returned from light sleep, reason: pin, t=197427 ms, slept for 1582 ms
Entering light sleep
Returned from light sleep, reason: pin, t=199001 ms, slept for 1565 ms
Entering light sleep
Returned from light sleep, reason: pin, t=200602 ms, slept for 1593 ms
Entering light sleep
Returned from light sleep, reason: pin, t=202194 ms, slept for 1583 ms
Entering light sleep
Returned from light sleep, reason: pin, t=203759 ms, slept for 1557 ms
Entering light sleep
Returned from light sleep, reason: pin, t=205353 ms, slept for 1585 ms
Entering light sleep
Returned from light sleep, reason: pin, t=206928 ms, slept for 1566 ms
Entering light sleep
Returned from light sleep, reason: pin, t=208559 ms, slept for 1622 ms
Entering light sleep
Returned from light sleep, reason: pin, t=210176 ms, slept for 1608 ms
Entering light sleep
Returned from light sleep, reason: pin, t=211766 ms, slept for 1581 ms
Entering light sleep
Returned from light sleep, reason: pin, t=213374 ms, slept for 1600 ms
Entering light sleep
Returned from light sleep, reason: pin, t=214991 ms, slept for 1607 ms
Entering light sleep
Returned from light sleep, reason: pin, t=216578 ms, slept for 1579 ms
Entering light sleep
Returned from light sleep, reason: pin, t=218185 ms, slept for 1598 ms
Entering light sleep