Changes the current value of the semaphore count. This function is normally selected when a semaphore is used as a signaling mechanism.
OSSemSet() can then be used to reset the count to any value. If the semaphore count is already 0, the count is only changed if there are no tasks waiting on the semaphore.
is a pointer to the semaphore that is used as a signaling mechanism.
is the desired count that the semaphore should be set to.
is a pointer to a variable used to hold an error code:
If the count was changed.
OS_CFG_ARG_CHK_EN is set to
p_sem is a
OS_CFG_OBJ_TYPE_CHK_EN is set to
p_sem is not pointing to a semaphore.
OS_CFG_CALLED_FROM_ISR_CHK_EN set to
os_cfg.h: if this function was called from an ISR.
If tasks are waiting on the semaphore, the count is not changed.
OS_CFG_SEM_SET_EN must be enabled in
os_cfg.h. Refer to µC-OS-III Configuration Manual.
- Do not use this function if the semaphore is used to protect a shared resource.