Description
Aborts and readies any tasks currently waiting on an event flag group. This function would be used by another task to fault abort the wait on the event flag group, rather than to normally signal the event flag group via OSFlagPost()
.
Files
os.h/os_flag.c
Prototype
Code Block |
---|
OS_OBJ_QTY OSFlagPendAbort (OS_FLAG_GRP *p_grp,
OS_OPT opt,
OS_ERR *p_err) |
Arguments
p_grp
is a pointer to the event flag group for which pend(s) must be aborted.
...
If OS_CFG_ARG_CHK_EN
is set to 1
in DEF_ENABLED
in os_cfg.h
: if p_grp
is a NULL
pointer.
...
If OS_CFG_OBJ_TYPE_CHK_EN
is set to 1
in DEF_ENABLED
in os_cfg.h
: if p_grp
is not pointing to an event flag group.
...
If OS_CFG_ARG_CHK_EN
is set to 1
in DEF_ENABLED
in os_cfg.h
: if specifying an invalid option.
OS_ERR_OS_NOT_RUNNING
If OS_CFG_INVALID_OS_CALLS_CHK_EN
is set to DEF_ENABLED
in os_cfg.h
: if µC/OS-III is not running yet.
OS_ERR_PEND_ABORT_ISR
If OS_CFG_CALLED_FROM_ISR_CHK_EN
set to 1
in DEF_ENABLED
in os_cfg.h
: This function cannot be called from an ISR.
...
No task was aborted since no task was waiting.
Returned Value
OSFlagPendAbort()
returns the number of tasks made ready-to-run by this function. Zero indicates that no tasks were pending on the event flag group and thus this function had no effect.
Required Configuration
OS_CFG_FLAG_EN
and OS_CFG_FLAG_PEND_ABORT_EN
must be enabled in os_cfg.h
. Refer to uCµC-OS-III Configuration Manual.
Callers
Application.
Notes/Warnings
- Event flag groups must be created before they are used.
Example Usage
Code Block | ||
---|---|---|
| ||
OS_FLAG_GRP EngineStatus;
void Task (void *p_arg)
{
OS_ERR err;
OS_OBJ_QTY nbr_tasks;
(void)&p_arg;
while (DEF_ON) {
:
:
nbr_tasks = OSFlagPendAbort(&EngineStatus,
OS_OPT_PEND_ABORT_ALL,
&err);
/* Check "err" */
:
:
}
} |