CMSIS-RTOS
Version 1.02
CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.
|
Control or wait for signal flags. More...
Macros | |
#define | osFeature_Signals 8 |
maximum number of Signal Flags available per thread More... | |
Functions | |
int32_t | osSignalSet (osThreadId thread_id, int32_t signals) |
Set the specified Signal Flags of an active thread. More... | |
int32_t | osSignalClear (osThreadId thread_id, int32_t signals) |
Clear the specified Signal Flags of an active thread. More... | |
osEvent | osSignalWait (int32_t signals, uint32_t millisec) |
Wait for one or more Signal Flags to become signaled for the current RUNNING thread. More... | |
The Signal Management function group allows to control or wait signal flags. Each thread has assigned signal flags.
#define osFeature_Signals 8 |
The CMSIS-RTOS API may support a variable number of signal flags. This define specifies the number of signal flags available per thread. The maximum value is 31 signal flags per thread.
int32_t osSignalClear | ( | osThreadId | thread_id, |
int32_t | signals | ||
) |
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signals | specifies the signal flags of the thread that shall be cleared. |
Clear the signal flags of an active thread. This function may be used also within interrupt service routines.
Example
int32_t osSignalSet | ( | osThreadId | thread_id, |
int32_t | signals | ||
) |
[in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId. |
[in] | signals | specifies the signal flags of the thread that should be set. |
Set the signal flags of an active thread. This function may be used also within interrupt service routines.
Example
osEvent osSignalWait | ( | int32_t | signals, |
uint32_t | millisec | ||
) |
[in] | signals | wait until all specified signal flags set or 0 for any single signal flag. |
[in] | millisec | timeout value or 0 in case of no time-out. |
Suspend the execution of the current RUNNING thread until all specified signal flags with the parameter signals are set. When this signal flags are already set, the function returns instantly. Otherwise the thread is put into the state WAITING. Signal flags that are reported as event are automatically cleared.
The argument millisec specifies how long the system waits for the specified signal flags. While the system waits the tread calling this function is put into the state WAITING. The timeout value can have the following values:
Example