You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP: rp2: Use the soft timer hardware alarm to wake from lightsleep.
Fixes issue where PICO-W build won't lightsleep() for more than 64ms. This
is a regression introduced in 74fb42a when we switched away from the
pico-sdk alarm pool for soft timers and accidentally made soft timer expiry
a wakeup source.
Before 74fb42a, both the pico-sdk alarm pool and the lightsleep wakeup
timer uses alarm 3. The lightsleep wakeup would quietly clobber alarm 3's
timeout, meaning softtimer wouldn't wake the chip from lightsleep.
After 74fb42a, soft timer wakeup happens on timer alarm 2 so this interrupt
wakes the chip from light sleep. On PICO-W builds this happens every lwIP
tick (64ms).
The change is to go back to using the same time alarm for both lightsleep
wakeup and soft timer, but now being explicit about lightsleep wakeup
clobbering any soft timer wakeup. Also adds a "catch up" call to soft timer
handler as it's not currently there.
This also pulls out the changes added in 19844b to enable the timer IRQ on
CPU1. The same thing should be covered by the changes in 9db16cf which
explicitly trigger a wakeup event from CPU0 to CPU1 any time the soft timer
handler fires. TBC.
This work was funded through GitHub Sponsors.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
0 commit comments