Signal Management

| CMSIS-RTOS Version 1.00 CMSIS-RTOS API: Generic RTOS interface for Cortex-M processor-based devices.

- CMSIS
- CORE
- DSP
- RTOS API
- SVD

- Main Page
- Usage and Description
- Reference

Defines | Functions
Signal Management
CMSIS-RTOS API

Control or wait for signal flags. More...

## Defines

#define | osFeature_Signals 8
| maximum number of Signal Flags available per thread

## Functions

int32_t | osSignalSet (osThreadId thread_id, int32_t signal)
| Set the specified Signal Flags of an active thread.
int32_t | osSignalClear (osThreadId thread_id, int32_t signal)
| Clear the specified Signal Flags of an active thread.
int32_t | osSignalGet (osThreadId thread_id)
| Get Signal Flags status of an active thread.
osEvent | osSignalWait (int32_t signals, uint32_t millisec)
| Wait for one or more Signal Flags to become signaled for the current RUNNING thread.

## Description

The Signal Management function group allows to control or wait signal flags. Each thread has assigned signal flags.

## Define Documentation

#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.

## Function Documentation

int32_t osSignalClear | ( | osThreadId | thread_id,
|  | int32_t | signals
| ) |  |

Parameters:

  [in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId.
  [in] | signals | specifies the signal flags of the thread that shall be cleared.

Returns:
  previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.

Note:
  MUST REMAIN UNCHANGED: osSignalClear shall be consistent in every CMSIS-RTOS.

Clear the signal flags of an active thread. This function may be used also within interrupt service routines.

int32_t osSignalGet | ( | osThreadId | thread_id | ) |

Parameters:

  [in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId.

Returns:
  previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.

Note:
  MUST REMAIN UNCHANGED: osSignalGet shall be consistent in every CMSIS-RTOS.

Return the event flags of an active thread. This function may be used also within interrupt service routines. Signal flags that are returned are automatically cleared.

int32_t osSignalSet | ( | osThreadId | thread_id,
|  | int32_t | signals
| ) |  |

Parameters:

  [in] | thread_id | thread ID obtained by osThreadCreate or osThreadGetId.
  [in] | signals | specifies the signal flags of the thread that should be set.

Returns:
  previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters.

Note:
  MUST REMAIN UNCHANGED: osSignalSet shall be consistent in every CMSIS-RTOS.

Set the signal flags of an active thread. This function may be used also within interrupt service routines.

osEvent osSignalWait | ( | int32_t | signals,
|  | uint32_t | millisec
| ) |  |

Parameters:

  [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.

Returns:
  event flag information or error code.

Note:
  MUST REMAIN UNCHANGED: osSignalWait shall be consistent in every CMSIS-RTOS.

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.

When millisec is set to osWaitForever the function will wait for an inifinite time until a message queue slot becomes available.

Status and Error Codes

- osOK: no signal received when the timeout value millisec was zero.
- osEventTimeout: signal not occurred within timeout
- osEventSignal: signal occurred, value.signals contains the signal flags; these signal flags are cleared.
- osErrorValue: the value signals is outside of the permitted range.
- osErrorISR: osSignalWait cannot be called from interrupt service routines.