- 121 -
[
[[
[
E
Ex
xa
am
mp
pl
le
e
p
pr
ro
og
gr
ra
am
m
s
st
ta
at
te
em
me
en
nt
t
]
]]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
VP_INT data[10];
void task(void)
{
:
if( snd_dtq( ID_dtq, data[0]) == E_RLWAI ){
error(“Forced released\n”);
}
:
if( psnd_dtq( ID_dtq, data[1])== E_TMOUT ){
error(“Timeout\n”);
}
:
if( tsnd_dtq( ID_dtq, data[2], 10 ) != E_ TMOUT ){
error(“Timeout \n”);
}
:
if( fsnd_dtq( ID_dtq, data[3]) != E_OK ){
error(“error\n”);
}
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
_g_dtq: .LWORD 12345678H
task: :
PUSH.W R2
PUSHM R6R4,R3R1
tsnd_dtq #ID_DTQ1,_g_dtq,#100
:
PUSH.W R2
PUSHM R3R1
psnd_dtq #ID_DTQ2,#0FFFFFFFFH
:
PUSH.W R2
PUSHM R3R1
fsnd_dtq #ID_DTQ3,#0ABCDH
: