Description
Sets or clears event flag bits. The bits set or cleared are specified in a bit mask (i.e., the flags argument). OSFlagPost()
readies each task that has its desired bits satisfied by this call. The caller can set or clear bits that are already set or cleared.
Files
os.h/os_flag.c
Prototype
Arguments
p_grp
is a pointer to the event flag group.
...
If OS_CFG_OBJ_TYPE_CHK_EN
is set to 1
in os_cfg.h
: p_grp
is not pointing to an event flag group.
Returned Value
The new value of the event flags.
Required Configuration
OS_CFG_FLAG_EN
must be enabled in os_cfg.h. Refer to uC-OS-III Configuration Manual
Callers
Application and ISRs.
Notes/Warnings
- Event flag groups must be created before they are used.
- The execution time of this function depends on the number of tasks waiting on the event flag group. However, the execution time is still deterministic.
- Although the example below shows that we are posting from a task,
OSFlagPost()
can also be called from an ISR.
Example