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

...

You can set or clear event flag bits by calling OSFlagPost(). 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.anchor10003351000335

Arguments

...

1000336p_grpanchor10003371000337

is a pointer to the event flag group.

...

flags Anchor10003391000339

specifies which bits to be set or cleared. If opt is OS_OPT_POST_FLAG_SET, each bit that is set in flags will set the corresponding bit in the event flag group. For example to set bits 0, 4, and 5, you would set flags to 0x31 (note that bit 0 is the least significant bit). If opt is OS_OPT_POST_FLAG_CLR, each bit that is set in flags will clear the corresponding bit in the event flag group. For example to clear bits 0, 4, and 5, you would specify flags as 0x31 (again, bit 0 is the least significant bit).

Anchor10003401000340opt Anchor10003411000341

indicates whether the flags are set (OS_OPT_POST_FLAG_SET) or cleared (OS_OPT_POST_FLAG_CLR).

...

The caller may also “add” OS_OPT_POST_NO_SCHED so that µC/OS-III will not call the scheduler after the post.

...

p_err Anchor10003441000344

is a pointer to an error code and can be:

...

classWebWorks_Indent_1

...

...

OS_ERR_NONE

...

classWebWorks_Indent_2

...

the call is successful.

...

classWebWorks_Indent_1

...

...

OS_ERR_FLAG_INVALID_OPT

...

classWebWorks_Indent_2

...

if OS_CFG_ARG_CHK_EN is set to 1 in os_cfg.h: if you specified an invalid option.

...

...

OS_ERR_OBJ_PTR_NULL

...

classWebWorks_Indent_2

...

if OS_CFG_ARG_CHK_EN is set to 1 in os_cfg.h: if the caller passed a NULL pointer.

...

classWebWorks_Indent_1

...

OS_ERR_OBJ_TYPE

...

...

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

Anchor10003541000354The new value of the event flags. Anchor10003551000355

Notes/Warnings

...

Example

...

rowspan21

...