
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
69
(2) Waiting for event flags
Use the system call, os_wait_flg, to enter the flag wait state. For
example, to wait until flags 1, 2, and 3 are set on, specify 0...0111 as
the parameter of os_wait_flg. (This parameter is referred to as the
wait message.) In addition, use an argument of os_wait_flg to specify
whether to perform AND wait or OR wait.
(a) OR wait
The wait state is maintained until at least one of flags 1, 2, and
3 is signaled. If flag 1, 2, or 3 in the event flag image is already
set on, the wait state is not entered (when one of these flags was
previously signaled by os_sign_flg).
Operation
if (wait message & image = 0)
Wait → Entering the wait state for the wait message
Image
0..0000XXX
wait message
0..0000111
AND
XXX=1 (true)
XXX=0(false)
Waiting for the signal of flag 1, 2, or 3
0..0XXX NO wait
(b) AND wait
The wait state is maintained until all three flags (1, 2, and 3) are
signaled. If a flag is already set in the event flag image, it is not
considered as the flag to be awaited. For example, if flags 1 and
2 are already set in the event flag image, only the signal of flag
3 is awaited.
If all three flags (1, 2, and 3) are already set in the event flag
image, the wait state is not entered.
Operation
wait message = ~image & wait message
if (wait message != 0)
Wait → Entering the wait state for the wait message
wait message
0..0000111
Image
0..0000XXX
Not
X..XXXXX00
AND
XXX=0 (false)
0..0XXX NO wait
XXX=1 (true)
Waiting for the signal of flag 3
CAUTION
The flags previously signaled by os_sign_flg are stored in
the event flag image. Whether to enter the wait state by
os_wait_flg depends on the contents of the event flag
image.