Skip to content
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

mbed_wait_api: add comments to warn the func will lock deep sleep #6645

Merged
merged 5 commits into from
May 8, 2018
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions platform/mbed_wait_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,32 @@ extern "C" {
* the accuracy of single precision floating point).
*
* @param s number of seconds to wait
*
* @note
* This function always spins to get the exact number of microseconds,
* which potentially affects power (such as preventing deep sleep) and multithread performance.
* You can avoid it by using Thread::wait().
*/
void wait(float s);

/** Waits a number of milliseconds.
*
* @param ms the whole number of milliseconds to wait
*
* @note
* This function always spins to get the exact number of microseconds,
* which potentially affects power (such as preventing deep sleep) and multithread performance.
* You can avoid it by using Thread::wait().
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @woodsking2 - The rtos based implementation of this function does call Thread::wait. So this comment is not broadly applicable.

*/
void wait_ms(int ms);

/** Waits a number of microseconds.
*
* @param us the whole number of microseconds to wait
*
* @note
* This function always spins to get the exact number of microseconds,
* which potentially affects power (such as preventing deep sleep) and multithread performance.
*/
void wait_us(int us);

Expand Down