...
'p_err' gets set to OS_ERR_NONE
before OSSched()
to allow the returned error code to be monitored (by another task) even for a task that is deleting itself. In this case, p_err
must point to a global variable that can be accessed by that other task and, you should initialize that variable to OS_ERR_TASK_RUNNING
prior to deleting the task.
OS_ERR_TASKILLEGAL_DEL_RUN_IDLE
...
TIME
If OS_SAFETY_CRITICAL_IEC61508
is defined: you called this after calling OSStart()
and thus you are no longer allowed to delete kernel objects.
OS_ERR_TASKOS_DELNOT_ISRRUNNING
If If OS_CFG_CALLEDINVALID_FROMOS_ISRCALLS_CHK_EN
set to 1
in is set to DEF_ENABLED
in os_cfg.h
: if you called OSTaskDel()
from an ISRif µC/OS-III is not running yet.
OS_ERR_STATE_INVALID
If the task is in an invalid state.
OS_ERR_TASK_DEL_IDLE
If attempting to delete the idle task.
OS_ERR_TASK_DEL_INVALID
If attempting to delete the ISR Handler task while while OS_CFG_ISR_POST_DEFERRED_EN
is set to 1 is set to DEF_ENABLED
.
OS_ERR_TASK_DEL_ISR
If OS_CFG_CALLED_FROM_ISR_CHK_EN
set to DEF_ENABLED
in os_cfg.h
: if you called OSTaskDel()
from an ISR.
Returned Value
None
Required Configuration
None
OS_CFG_TASK_DEL_EN
must be enabled in os_cfg.h
. Refer to µC-OS-III Configuration Manual.
Callers
Application.
Notes/Warnings
OSTaskDel()
verifies that the user is not attempting to delete the µC/OS-III idle task and the ISR handler task.- Be careful when deleting a task that owns resources.