Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RP2040: ignore pin changes before deep sleep #7196

Merged
merged 1 commit into from
Nov 12, 2022

Conversation

dhalbert
Copy link
Collaborator

Fixes #7081

Ignore pin alarm changes before deep sleep has started. Previously, the pin could change, triggering the interrupt handler, and clearing the alarm setup, preventing detecting pin change during deep sleep. Now the interrupt routine ignores changes until the last possible moment. There is a tiny sliver of a race condition, but it is very, very narrow.

@billedluh Could you test this? IThanks. tested on a Feather RP2040, grounding a jumper many times before sleep. I was able to reproduce your #7081 problem, but could not after this fix.

To find a build to try, wait until the builds have finished. Then click on the "Details" link next to an RP2040 build below, then click on Summary at the top of the left sidebar, and then scroll down to find the "Artifacts". Download the .zip and unpack it to find a .uf2 to load.

@dhalbert dhalbert requested a review from jepler November 11, 2022 20:36
Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accepting as an improvement over the status quo.

@dhalbert dhalbert merged commit 9e94d7e into adafruit:main Nov 12, 2022
@dhalbert dhalbert deleted the rp2-pin-alarm-race branch November 12, 2022 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

alarm.exit_and_deep_sleep_until_alarms() not exiting sleep when interrupted
2 participants