Download RI78V4 Real-Time Operating System User`s Manual: Coding

Transcript
RI78V4 V2.00.00
CHAPTER 12 SERVICE CALLS
ter_tsk
Outline
Terminate task.
C format
ER
ter_tsk ( ID tskid );
Assembly format
MOV
CALL
A, #tskid
!!_ter_tsk
Parameter(s)
I/O
Parameter
I
ID
Description
ID number of the task to be terminated.
tskid;
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 RI78V4 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 1
This service call does not return the OS resource that the target task acquired by issuing a service call such as
sig_sem or get_mpf. The OS resource have been acquired must therefore be returned before issuing this
service call.
Note 2
When moving a task to the DORMANT state, this service call initializes the following information to values that
are set during task creation.
- Priority (current priority)
- Wakeup request count
- Suspension count
- Interrupt status
Return value
Macro
Value
E_OK
0
E_OBJ
-41
R20UT3375EJ0100 Rev.1.00
2015.03.25
Description
Normal completion.
Object state error (specified task is in the DORMANT state).
Page 168 of 309