Wrong wake up reason
Posted: Fri Nov 10, 2017 6:26 am
I set the GPIO37 as the ext1 trigger pin to wake up the ESP32 chip from deepsleep, but got :
Wake up from GPIO 5
I tried to use GPIO36,got:
Wake up from GPIO 4
When I set GPIO4 as the ext1 trigger pin to wake up the ESP32 chip from deepsleep, got :
Wake up from GPIO 4
too.
I guess that the result was MOD by 32.
I checked the code:
It seems the __builtin_ffsll is a builtin function without code.Any one have any suggestion to solve the issue?Thanx!
Wake up from GPIO 5
I tried to use GPIO36,got:
Wake up from GPIO 4
When I set GPIO4 as the ext1 trigger pin to wake up the ESP32 chip from deepsleep, got :
Wake up from GPIO 4
too.
I guess that the result was MOD by 32.
I checked the code:
Code: Select all
switch (reason)
{
case ESP_DEEP_SLEEP_WAKEUP_EXT1:
{
uint64_t wakeup_pin_mask = esp_deep_sleep_get_ext1_wakeup_status();
if (wakeup_pin_mask != 0)
{
int pin = __builtin_ffsll(wakeup_pin_mask) - 1;
wakeup_gpio_pin = pin;
printf("Wake up from GPIO %d\n", pin);
}
else
{
printf("Wake up from GPIO\n");
}
break;
}