I am not able to configure wakeup and also attach the interrupt to the same pin (non RTC pin). Any attempt to attach or detach interrupt on wakeup pin cancel the wakeup function and vice versa. Is there any way to properly set both fucntions on same pin at once or do I have to configure wakeup before sleep and attach interrupt after wakeup each cycle? What are the best practices in this case?
Thank you
Code: Select all
detachInterrupt(digitalPinToInterrupt(20));
gpio_wakeup_enable(GPIO_NUM_20, GPIO_INTR_LOW_LEVEL);
esp_sleep_enable_gpio_wakeup();
esp_light_sleep_start();
attachInterrupt(digitalPinToInterrupt(20), test, CHANGE);