Download RI78V4 Real-Time Operating System User`s Manual: Coding
Transcript
RI78V4 V2.00.00
4.8
CHAPTER 4 TASK DEPENDENT SYNCHRONIZATION FUNCTIONS
Delay Task
A task is moved to the delayed state by issuing the following service call from the processing program.
- dly_tsk
This service call moves the invoking task from the RUNNING state to the WAITING state (delayed state).
As a result, the invoking task is unlinked from the ready queue and excluded from the RI78V4 scheduling subject.
The delayed state is cancelled in the following cases, and then moved to the READY state.
Delayed State Cancel Operation
Return Value
Delay time specified by parameter dlytim has elapsed.
E_OK
Forced release from waiting (accept rel_wai while waiting).
E_RLWAI
Forced release from waiting (accept irel_wai while waiting).
E_RLWAI
The following describes an example for coding this service call.
#include
#include
<kernel.h>
<kernel_id.h>
void
func_task ( VP_INT exinf )
{
ER
ercd;
RELTIM dlytim = 3600;
/*Standard header file definition*/
/*System information header file definition*/
/*Declares variable*/
/*Declares and initializes variable*/
/* ............ */
ercd = dly_tsk ( dlytim );
if ( ercd == E_OK )
/* ............
} else if ( ercd ==
/* ............
}
/*Delay task*/
{
*/
/*Normal termination processing*/
E_RLWAI ) {
*/
/*Forced termination processing*/
/* ............ */
}
R20UT3375EJ0100 Rev.1.00
2015.03.25
Page 47 of 309