...
to block the caller until the semaphore is available or a timeout occurs.
OS_OPT_PEND_NON_BLOCKING
if If the semaphore is not available, OSSemPend()
will not block but return to the caller with an appropriate error code.
...
is a pointer to a variable used to hold an error code:
OS_ERR_NONE
if If the semaphore is available.
OS_ERR_OBJ_DEL
if If the semaphore was deleted.
OS_ERR_OBJ_PTR_NULL
if If OS_CFG_ARG_CHK_EN
is set to 1
in os_cfg.h
: if p_sem
is a NULL
pointer.
OS_ERR_OBJ_TYPE
if If OS_CFG_OBJ_TYPE_CHK_EN
is set to 1
in os_cfg.h
: if p_sem
is not pointing to a semaphore.
OS_ERR_OPT_INVALID
if If OS_CFG_ARG_CHK_EN
is set to 1
in os_cfg.h
: if opt
is not OS_OPT_PEND_NON_BLOCKING or
OS_OPT_PEND_BLOCKING
.
...
if
the pend was aborted
OS_ERR_PEND_ISR
if If OS_CFG_CALLED_FROM_ISR_CHK_EN
set to 1
in os_cfg.h
: if
this function is called from an ISR.
...
if
this function is called as specified OS_OPT_PEND_NON_BLOCKING
, and the semaphore was not available.
OS_ERR_SCHED_LOCKED
if If calling this function when the scheduler is locked.
OS_ERR_TIMEOUT
if If the semaphore is not signaled within the specified timeout.
...