The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Revision:
172:65be27845400
Parent:
170:e95d10626187
--- a/platform/mbed_wait_api.h	Thu Nov 08 11:45:42 2018 +0000
+++ b/platform/mbed_wait_api.h	Wed Feb 20 20:53:29 2019 +0000
@@ -8,6 +8,7 @@
 
 /* mbed Microcontroller Library
  * Copyright (c) 2006-2013 ARM Limited
+ * SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,9 +56,9 @@
  *  @param s number of seconds to wait
  *
  *  @note
- *    If the RTOS is present, 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().
+ *    If the RTOS is present, this function spins to get the exact number of microseconds for
+ *    microsecond precision up to 10 milliseconds. If delay is larger than 10 milliseconds and not in ISR, it is the same as
+ *    `wait_ms`. We recommend `wait_us` and `wait_ms` over `wait`.
  */
 void wait(float s);
 
@@ -66,9 +67,8 @@
  *  @param ms the whole number of milliseconds to wait
  *
  *  @note
- *    If the RTOS is present, 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().
+ *    If the RTOS is present, it calls ThisThread::sleep_for(), which is same as CMSIS osDelay().
+ *    You can't call this from interrupts, and it doesn't lock hardware sleep.
  */
 void wait_ms(int ms);
 
@@ -77,8 +77,9 @@
  *  @param us the whole number of microseconds to wait
  *
  *  @note
- *    If the RTOS is present, this function always spins to get the exact number of microseconds,
- *    which potentially affects power (such as preventing deep sleep) and multithread performance.
+ *    This function always spins to get the exact number of microseconds.
+ *    If RTOS is present, this will affect power (by preventing deep sleep) and
+ *    multithread performance. Therefore, spinning for millisecond wait is not recommended.
  */
 void wait_us(int us);