Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
Functions | |
uint64_t | get_ms_count (void) |
Generic thread functions. | |
void | thread_sleep_for (uint32_t millisec) |
Sleep for a specified time period in millisec: | |
void | thread_sleep_until (uint64_t millisec) |
Sleep until a specified time in millisec The specified time is according to Kernel::get_ms_count(). |
Function Documentation
uint64_t get_ms_count | ( | void | ) |
Generic thread functions.
These are C versions of functions provided in C++ via rtos::Thread and rtos::ThisThread Read the current RTOS kernel millisecond tick count. The tick count corresponds to the tick count the RTOS uses for timing purposes. It increments monotonically from 0 at boot, so it effectively never wraps. If the underlying RTOS only provides a 32-bit tick count, this method expands it to 64 bits.
- Returns:
- RTOS kernel current tick count
- Note:
- Mbed OS always uses millisecond RTOS ticks, and this could only wrap after half a billion years.
- In a non-RTOS build, this computes an equivalent time in milliseconds, based on a HAL timer. The time may be referenced as 0 on first call.
- You cannot call this function from ISR context.
- The equivalent functionality is accessible in C++ via rtos::Kernel::get_ms_count.
Definition at line 31 of file mbed_thread.cpp.
void thread_sleep_for | ( | uint32_t | millisec ) |
Sleep for a specified time period in millisec:
- Parameters:
-
millisec time delay value
- Note:
- You cannot call this function from ISR context.
- The equivalent functionality is accessible in C++ via rtos::ThisThread::sleep_for.
Definition at line 40 of file mbed_thread.cpp.
void thread_sleep_until | ( | uint64_t | millisec ) |
Sleep until a specified time in millisec The specified time is according to Kernel::get_ms_count().
- Parameters:
-
millisec absolute time in millisec
- Note:
- You cannot call this function from ISR context.
- if millisec is equal to or lower than the current tick count, this returns immediately.
- The equivalent functionality is accessible in C++ via ThisThread::sleep_until.
Definition at line 50 of file mbed_thread.cpp.
Generated on Tue Jul 12 2022 13:55:26 by
