QUERY · ISSUE
ESP32 timer wake up repeating
bugport-esp32
I'm using timer wakeup from light sleep with:
machine.lightsleep(30000) #sleep 30s
after 30 the esp32 wakes, disable peripherals and sleep indefinitely with:
machine.lightsleep()
but the 30s wake timer keeps repeating and didn't find any way to disable wake source
CANDIDATE · PULL REQUEST
rp2/modmachine: Implement lightsleep() with optional sleep period.
port-rp2
This gets basic machine.lightsleep([n]) working on the rp2 port.
It supports:
- Calling
lightsleepwithout a specified period, in which case it uses xosc dormant mode. There's currently no way to wake it up from this state, unless you write to raw registers to enable a GPIO wake up source. - Calling
lightsleepwith a periodnin milliseconds. This period must be less than about 72 minutes and uses timer alarm3 to wake it up.
The RTC continues to run during lightsleep, but other peripherals have their clock turned off during the sleep.
It doesn't yet support:
- Longer periods than 72 minutes (could use the RTC for this).
- Wake up from GPIO IRQ.
Fixes issue #8770.