Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

OS_OBJ_QTY  OSQPendAbort (OS_Q    *p_q,
                          OS_OPT   opt,
                          OS_ERR  *p_err)

File

Called from

Code enabled by

os_q.c

Task only

OS_CFG_Q_EN and OS_CFG_Q_PEND_ABORT_EN

OSQPendAbort() aborts and readies any tasks currently waiting on a message queue. This function should be used to fault-abort the wait on the message queue, rather than to signal the message queue via OSQPost().

Arguments

p_q

is a pointer to the queue for which pend(s) need to be aborted.

opt

determines the type of abort to be performed.

OS_OPT_PEND_ABORT_1

Aborts the pend of only the highest-priority task waiting on the message queue.

OS_OPT_PEND_ABORT_ALL

Aborts the pend of all tasks waiting on the message queue.

OS_OPT_POST_NO_SCHED

specifies that the scheduler should not be called, even if the pend of a higher-priority task has been aborted. Scheduling will need to occur from another function.

You would use this option if the task calling OSQPendAbort() is doing additional pend aborts, rescheduling is not performed until completion, and multiple pend aborts are to take effect simultaneously.

 

p_err

is a pointer to a variable that holds an error code:

OS_ERR_NONE

at least one task waiting on the message queue was readied and informed of the aborted wait. Check the return value for the number of tasks whose wait on the message queue was aborted.

OS_ERR_PEND_ABORT_ISR

If OS_CFG_CALLED_FROM_ISR_CHK_EN set to 1 in os_cfg.h: if called from an ISR

OS_ERR_PEND_ABORT_NONE

If no task was pending on the message queue

OS_ERR_OBJ_PTR_NULL

If OS_CFG_ARG_CHK_EN is set to 1 in os_cfg.h: if p_q is a NULL pointer.

OS_ERR_OBJ_TYPE

If OS_CFG_OBJ_TYPE_CHK_EN is set to 1 in os_cfg.h: if p_q is not pointing to a message queue.

OS_ERR_OPT_INVALID

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

Returned Value

OSQPendAbort() returns the number of tasks made ready-to-run by this function. Zero indicates that no tasks were pending on the message queue, therefore this function had no effect.

Notes/Warnings

Queues must be created before they are used.

Example

  • No labels