- 115 -
[
[[
[
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”
void task()
{
UINT flgptn;
:
if(wai_flg(ID_flg2, (FLGPTN)0x00000ff0, TWF_ANDW, &flgptn)!=E_OK)
error(“Wait Released\n”);
:
:
if(pol_flg(ID_flg2, (FLGPTN)0x00000ff0, TWF_ORW, &flgptn)!=E_OK)
printf(“Not set EventFlag\n”);
:
:
if( twai_flg(ID_flg2, (FLGPTN)0x00000ff0, TWF_ANDW, &flgptn, 5) != E_OK )
error(“Wait Released\n”);
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
task: :
PUSH.W R2
PUSH.L A1
wai_flg #ID_FLG1,#00000003H,#TWF_ANDW
:
PUSH.W R2
PUSH.L A1
pol_flg #ID_FLG2,#00000008H,#TWF_ORW
:
PUSH.W R2
PUSH.L A1
PUSHM R6R4
wai_flg #ID_FLG3,#00000003H,#TWF_ANDW,20
: