-
Notifications
You must be signed in to change notification settings - Fork 157
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 thread_sleep_for
to sleep
#193
Use thread_sleep_for
to sleep
#193
Conversation
Justification for the change isn't correct - both calls do the same thing, including RTOS-vs-non-RTOS. I would expect a C++ app to use the C++ call, normally. If you're trying a bare-metal build, doing The C call is for convenience for C code (that was previously using |
@kjbracey-arm So are you saying that this PR is not necessary? |
Previously it did, but since ARMmbed/mbed-os#10104, you can get a subset of the RTOS API without the RTOS. For the "thread sleep" call, it's just a matter of spelling, but the RTOS API also gives you higher-level functions like
Not for the reasons given, at least. I think an update is required to https://os.mbed.com/docs/mbed-os/v5.14/reference/bare-metal-apis.html. |
|
thread_sleep_for
to sleepthread_sleep_for
to sleep
The "requires" mechanism as a whole doesn't seem to be really documented in the main docs anyway - I only see it in the "migrating from Mbed OS 2" tutorial. I recall seeing some discussion about this a few weeks back - maybe someone is already looking at it? |
This function allows the application to be built wit the bare metal profile without requiring `rtos-api`.
0fd1e7e
to
81a8ba3
Compare
FYI @AnotherButler @iriark01 again. @kjbracey-arm I have updated the PR description. |
The remaining question is "why do you want to exclude In the PR, I did consider for a while having If making an app, there's no real reason not to require A counter-argument is that if blinky is supposed to be the most-minimal-possible app, so should we be requiring something beyond the absolute bare minimum? But it does feel a bit like using |
TL;DR - I'm basically neutral on this PR, now the description has been updated - don't have a particular preference for either style. |
@kjbracey-arm |
Will adding "RTOS" to the list of bare metal APIs (https://os.mbed.com/docs/mbed-os/v5.14/reference/bare-metal-apis.html) solve this issue, or is there more to it? |
It's a subset of RTOS APIs. Some aren't applicable if you are in a single-thread environment, and a couple haven't been implemented, but could be in future. You can see a list in the commit message here: ARMmbed/mbed-os@83b329c Listing those 4 classes (plus The thing about the "requires" mechanism in the build system backing the bare metal build is a bit broader. |
I am catching this thread quite late. |
@kjbracey-arm would it make sense to change everything in this commit ARMmbed/mbed-os@a522dcf from My use case: I want to build an app with SD and with |
@amq Not really. There should be negligible size difference between the C and C++ API. They do exactly the same thing. The fact that you're asking the question kind of highlights a reason not to have made this change - giving the false impression that somehow using This change was only justified because the docs said to add The bare metal form of the RTOS API doesn't add any overhead - you only pay for the calls you use, so there's no real reason to not ask for it, apart from saving a teeny bit of compilation time. |
@kjbracey-arm the problem in my case is that SD builds just fine with
|
The Any folder with a |
Ahh, thank you, worked perfectly! |
This function allows the application to be built wit the bare metal profile without requiring the
rtos-api
.