Everything

ter_tsk

Outline
Terminate task.
C format
 ER      ter_tsk (ID tskid);
Parameter(s)
I/O
Parameter
Description
I
 ID      tskid;
ID number of the task to be terminated.

Explanation
This service call forcibly moves a task specified by parameter tskid to the DORMANT state.
As a result, the target task is excluded from the RI850V4 scheduling subject.
If an activation request has been queued to the target task (the activation request counter is not set to 0x0) when this service call is issued, this service call moves the task to the DORMANT state, decrements the wakeup request counter (by subtracting 0x1 from the wakeup request counter), and then moves the task from the DORMANT state to the READY state.
Note When moving a task to the DORMANT state, this service call initializes the following information to values that are set during task creation.
- Current priority
- Wakeup request count
- Suspension count
- Interrupt state
If the target task has locked a mutex, the locked state is released at the same time (processing equivalent to unl_mtx).
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- tskid < 0x0
- tskid > Maximum ID number
E_CTX
-25
Context error.
- This service call was issued from a non-task.
- This service call was issued in the CPU locked state.
E_ILUSE
-28
Illegal service call use.
- Specified task is an invoking task.
E_OBJ
-41
Object state error.
- Specified task is in the DORMANT state.
E_NOEXS
-42
Non-existent object.
- Specified task is not registered.