-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use usleep instead of sleep/nanosleep on Mbed OS. #8393
Merged
bzbarsky-apple
merged 2 commits into
project-chip:master
from
ARMmbed:use-usleep-instead-of-nanosleep-on-mbed
Aug 2, 2021
Merged
Use usleep instead of sleep/nanosleep on Mbed OS. #8393
bzbarsky-apple
merged 2 commits into
project-chip:master
from
ARMmbed:use-usleep-instead-of-nanosleep-on-mbed
Aug 2, 2021
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
pullapprove
bot
requested review from
andy31415,
bzbarsky-apple,
chrisdecenzo,
Damian-Nordic,
hawk248,
jepenven-silabs,
msandstedt and
mspang
July 14, 2021 19:30
andy31415
reviewed
Jul 14, 2021
andy31415
approved these changes
Jul 14, 2021
msandstedt
approved these changes
Jul 14, 2021
7 tasks
bzbarsky-apple
requested changes
Jul 15, 2021
pan-
force-pushed
the
use-usleep-instead-of-nanosleep-on-mbed
branch
from
July 15, 2021 22:27
1bc1116
to
4256ae3
Compare
Size increase report for "esp32-example-build" from 15669b6
Full report output
|
I use |
Damian-Nordic
approved these changes
Jul 20, 2021
bzbarsky-apple
approved these changes
Jul 23, 2021
@pan- See review comments? |
@bzbarsky-apple Hi, @pan- is on holiday so I take over this PR. I changed the casting according to your comments |
nanosleep isn't available with newlib which is used by many embedded targets.
ATmobica
force-pushed
the
use-usleep-instead-of-nanosleep-on-mbed
branch
from
August 2, 2021 10:45
c63e4a5
to
5a6ecb3
Compare
bzbarsky-apple
approved these changes
Aug 2, 2021
nikita-s-wrk
pushed a commit
to nikita-s-wrk/connectedhomeip
that referenced
this pull request
Sep 23, 2021
* Use usleep instead of nanoseep in tests to increase portability. nanosleep isn't available with newlib which is used by many embedded targets. * Use C++-style cast - static_cast replacement Co-authored-by: ATmobica <[email protected]>
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.
Problem
nanosleep
is not available on Mbed OS andsleep
as a different semantic compared to POSIX (not tie to newlib).Some unit tests actively use this feature which cause a compilation error.
Change overview
In unit tests, use
usleep
instead ofnanosleep
orsleep
when compiled for Mbed OS.Testing
Existing unit tests.