...
Files
os.h/os_flag.c
Prototype
Code Block |
---|
OS_FLAGS OSFlagPost (OS_FLAG_GRP *p_grp,
OS_FLAGS flags,
OS_OPT opt,
OS_ERR *p_err) |
Arguments
p_grp
is a pointer to the event flag group.
...
- 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 Usage
...
Code Block | ||
---|---|---|
| ||
#define ENGINE_OIL_PRES_OK 0x01
#define ENGINE_OIL_TEMP_OK 0x02
#define ENGINE_START 0x04
OS_FLAG_GRP EngineStatusFlags;
void TaskX (void *p_arg)
{
OS_ERR err;
OS_FLAGS flags;
(void)&p_arg;
while (DEF_ON) {
:
:
flags = OSFlagPost(&EngineStatusFlags,
ENGINE_START,
OS_OPT_POST_FLAG_SET,
&err);
/* Check 'err" */
:
:
}
} |