Wrong wake up reason

temp4eb
Posts: 35
Joined: Tue Jun 06, 2017 8:59 am

Wrong wake up reason

Postby temp4eb » 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:

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;
    }
    
It seems the __builtin_ffsll is a builtin function without code.Any one have any suggestion to solve the issue?Thanx!

krajaan
Posts: 16
Joined: Mon Mar 20, 2017 5:59 pm

Re: Wrong wake up reason

Postby krajaan » Sun Nov 12, 2017 4:26 pm

Hi,
just wanted to say that I've noticed the same problem.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Wrong wake up reason

Postby WiFive » Sun Nov 12, 2017 5:06 pm


temp4eb
Posts: 35
Joined: Tue Jun 06, 2017 8:59 am

Re: Wrong wake up reason

Postby temp4eb » Mon Nov 13, 2017 3:14 am


Who is online

Users browsing this forum: Baidu [Spider] and 152 guests