Repository navigation
WIP: rp2: Enable GPIO wakeup from indefinite lightsleep, document sleep modes. - #16442
Draft
projectgus wants to merge 4 commits into
Draft
projectgus wants to merge 4 commits into
projectgus wants to merge 4 commits into
Conversation
|
Code size report: |
Contributor
|
Just ran afoul of this while testing #16454 so I'm dropping a cross reference in for posterity. |
Before this commit, a Pin with an irq() trigger is a wakeup source only when machine.lightsleep(n) is used with a timeout, and only if an IRQ handler is set. After this commit: - A Pin with an irq() trigger is a wakeup source from both indefinite machine.lightsleep() and machine.lightsleep(n) with a timeout. - A Pin with an irq() trigger is a wakeup source even if no handler function is set. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
Similar to disabling the USB clock for other light sleep modes, the DORMANT mode seems to put an active USB peripheral into a bad state at least some of the time. Workaround by not selecting DORMANT mode in this case. Also removes the unused use_timer_alarm flag. Can be added back in the future if someone wants to implement RTC wakeup from light sleep. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
projectgus
force-pushed
the
bugfix/rp2_lightsleep_indefinite_wake
branch
from
July 2, 2026 07:16
450901a to
d5b698a
Compare
These modes have significant limitations that until now haven't been documented. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <[email protected]>
Signed-off-by: Angus Gratton <[email protected]>
projectgus
force-pushed
the
bugfix/rp2_lightsleep_indefinite_wake
branch
from
July 2, 2026 07:27
d5b698a to
0b3ba3e
Compare
Contributor
|
Does Pick SDK 2.3.0's Right now we're shouldering a near duplicate of |
Contributor
Author
I hadn't seen this API, thanks @Gadgetoid! This does look like the way forward.
Yes. There's a ticket open on pico-sdk for this (raspberrypi/pico-sdk#1746) - but it looks like pico_low_power might be the solution for it, already shipping. 🎉 |
This was referenced Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the
Pin.irq()wakeup behaviour more consistent on rp2. Closes #7035 and Closes #16180 (the last part of that issue to need fixing.)Pin.irq()trigger set will wake rp2 port from anymachine.lightsleep()call. (Previously this only worked if lightsleep had a timeout and the IRQ had a handler set.)TODOs
This work was funded through GitHub Sponsors.
Testing
Trade-offs and Alternatives