Skip to content

Commit 78d1269

Browse files
docstrings: Add granularity info to MicroBit::sleep() & remove return. (#248)
1 parent bd5e46e commit 78d1269

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

model/MicroBit.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,13 @@ namespace codal
215215
*
216216
* @param milliseconds the amount of time, in ms, to wait for. This number cannot be negative.
217217
*
218-
* @return MICROBIT_OK on success, MICROBIT_INVALID_PARAMETER milliseconds is less than zero.
218+
* @code
219+
* uBit.sleep(20); //sleep for 20ms
220+
* @endcode
219221
*
222+
* @note This operation is currently limited by the rate of the system timer, therefore
223+
* the granularity of the sleep operation is limited to 4 ms, unless the rate of
224+
* the system timer is modified.
220225
*/
221226
void sleep(uint32_t milliseconds);
222227

@@ -289,8 +294,13 @@ namespace codal
289294
*
290295
* @param milliseconds the amount of time, in ms, to wait for. This number cannot be negative.
291296
*
292-
* @return MICROBIT_OK on success, MICROBIT_INVALID_PARAMETER milliseconds is less than zero.
297+
* @code
298+
* uBit.sleep(20); //sleep for 20ms
299+
* @endcode
293300
*
301+
* @note This operation is currently limited by the rate of the system timer, therefore
302+
* the granularity of the sleep operation is limited to 4 ms, unless the rate of
303+
* the system timer is modified.
294304
*/
295305
inline void MicroBit::sleep(uint32_t milliseconds)
296306
{

0 commit comments

Comments
 (0)