I've been trying to interface with an accelerometer to use as a way to wakeup from sleep if the device is shaken and also put it to sleep on an inactivity timer. I've managed to get the device to go to sleep on the timer just fine and I thought I had correctly enabled gpio wakeup with the following
Code: Select all
gpio_wakeup_enable(LIS3DH_INTR, IRQ_WAKEUP_LEVEL == 1 ? GPIO_INTR_LOW_LEVEL : GPIO_INTR_HIGH_LEVEL);
esp_sleep_enable_gpio_wakeup();
I know for sure that I'm receiving interrupts because when it's not asleep I receive the interrupt just fine. Are there any obvious causes that I might be missing?
EDIT:
So after some testing if I shake the accelerometer while asleep when it eventually wakes up from sleep from a timer it fires the ISR and relevant task after