Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
OS_FLAGS  OSFlagPost (OS_FLAG_GRP  *p_grp,
                      OS_FLAGS      flags,
                      OS_OPT        opt,
                      OS_ERR       *p_err)

File

Called from

Code enabled by

os_flag.c

Task or ISR

OS_CFG_FLAG_EN

...

Description

Sets or rlears 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.

...

The new value of the event flags.

Required Configuration

OS_CFG_FLAG_EN must be enabled in os_cfg.h. Refer to µC/OS-III Configuration Manual

Callers

Application and ISRs.

Notes/Warnings

  1. Event flag groups must be created before they are used.
  2. 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.
  3. Although the example below shows that we are posting from a task, OSFlagPost() can also be called from an ISR.

Example