Skip to content

More sleep fixes#3079

Open
kilograham wants to merge 5 commits into
developfrom
another-sleep-fix
Open

More sleep fixes#3079
kilograham wants to merge 5 commits into
developfrom
another-sleep-fix

Conversation

@kilograham

Copy link
Copy Markdown
Contributor

fixes #3078

… 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
Comment thread test/pico_sync_test/pico_sync_test.c
Comment on lines +22 to +24
if (PICO_RP2040)
target_link_libraries(pico_time_test_sw PRIVATE pico_aon_timer)
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like you've got a if (PICO_RP2040) inside a if (NOT PICO_RP2040), so presumably this code will never be reached?

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants