-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/busy_wait: add busy wait helper #20241
Merged
Merged
Conversation
This file contains 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
benpicco
requested review from
leandrolanzieri,
aabadie,
MichelRottleuthner,
kaspar030,
gschorcht and
bergzand
as code owners
January 9, 2024 18:08
benpicco
requested review from
maribu
and removed request for
aabadie,
kaspar030,
bergzand,
leandrolanzieri,
MichelRottleuthner and
gschorcht
January 9, 2024 18:08
github-actions
bot
added
Platform: MSP
Platform: This PR/issue effects MSP-based platforms
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Area: tests
Area: tests and testing framework
Area: cpu
Area: CPU/MCU ports
Area: sys
Area: System
labels
Jan 9, 2024
benpicco
added
the
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
label
Jan 9, 2024
maribu
approved these changes
Jan 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one. The blinky example could also make use of this :-)
github-actions
bot
added
Platform: AVR
Platform: This PR/issue effects AVR-based platforms
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
labels
Jan 9, 2024
Teufelchen1
reviewed
Jan 10, 2024
kaspar030
reviewed
Jan 10, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Jan 11, 2024
@maribu if you run the test on MSP430 you can also provide |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: cpu
Area: CPU/MCU ports
Area: sys
Area: System
Area: tests
Area: tests and testing framework
CI: no fast fail
don't abort PR build after first error
CI: ready for build
If set, CI server will compile all applications for all available boards for the labeled PR
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Platform: AVR
Platform: This PR/issue effects AVR-based platforms
Platform: ESP
Platform: This PR/issue effects ESP-based platforms
Platform: MSP
Platform: This PR/issue effects MSP-based platforms
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.
Contribution description
We often need to wait for a short period of time before timers are initialized, e.g. in
board_init()
.Instead of ad-hoc busy wait implementations, provide a common
busy_wait()
helper function (taken from msp430) and add abusy_wait_us()
for a rough time approximation based on the CPU frequency.Testing procedure
A new test application is provided in
tests/sys/busy_wait
that will measure the diversion from the usec timer:samd20-xpro (Cortex M0+)
saml10-xpro (Cortex M23)
same54-xpro (Cortex M4F)
avr-rss2 (AVR8)
esp8266-esp-12x (ESP8266)
esp32-wroom-32 (ESP32)
esp32s2-wemos-mini (ESP32S2)
esp32s3-devkit (ESP32S3)
esp32c3-devkit (RISC-V)
sipeed-longan-nano (RISC-V)
Issues/PRs references