More sleep fixes#3079
Open
kilograham wants to merge 5 commits into
Open
Conversation
… just relying on a __wfe(), however if the callback happens before the lock_internal_spin_unlock_with_wait() then on RP2350 we will eat the (already happended event) while trying to discard the event from the spin lock acquire/release This doesn't affect other primitives like mutexes as they test some condition and breakout inside the spin lock, rather than using the event itself as a condition The solution (now that any timer event causes an IRQ) is to just use a __wfe() and post a __sev() from the callback (note the IRQ on the same core would cause an event, but the timer irq may be on ther other core)
… a wakeup in the future if an alarm was created and destroyed before the ta_set_timeout was ever called. we must always set an alarm if there is one
lurch
reviewed
Jul 19, 2026
lurch
reviewed
Jul 20, 2026
Comment on lines
+22
to
+24
| if (PICO_RP2040) | ||
| target_link_libraries(pico_time_test_sw PRIVATE pico_aon_timer) | ||
| endif() |
Contributor
There was a problem hiding this comment.
It looks like you've got a if (PICO_RP2040) inside a if (NOT PICO_RP2040), so presumably this code will never be reached?
lurch
reviewed
Jul 20, 2026
| add_executable(short_sleep_test short_sleep_test.c) | ||
| set_target_properties(short_sleep_test PROPERTIES PICO_TEST_TIMEOUT "20") | ||
| target_compile_definitions(short_sleep_test PRIVATE | ||
| PICO_TIME_SLEEP_OVERHEAD_ADJUST_US=0 |
Contributor
There was a problem hiding this comment.
It looks like you need to add this define to test/short_sleep_test/BUILD.bazel too? (Because the Bazel builds are currently failing CI)
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.
fixes #3078