
2. TASK CONTROL FUNCTION
B–61863E–1/06
PMC CONTROL SOFTWARE
70
(3) Flag signaling
To signal flags, use the system call, os_sign_flg or os_puls_flg.
To set flags 1, 2, and 3 on, for example, specify 0..0111 as the
parameter of os_sign_flg. (This parameter is referred to as a signal
message.) In this case, a task waiting for the specified flags is released
from the wait state.
D os_sign_flg (continuous-state mode)
Signaled flags are stored in the event flag image. As a result,
subsequently using os_wait_flg does not cause the signaled flags
to enter the wait state unless the event flag image is cleared.
D os_puls_flg (pulse mode)
Signaled flags are not stored in the event flag image. As a result,
subsequently using os_wait_flg causes the signaled flags to enter
the wait state again.
(a) Signal for OR wait
Operation
if(signal message & wait message != 0)
Signal → Releasing the wait state
wait message
0..0000111
signal message
0..0000XXX
Waiting for the signal of flag 1, 2, or 3
wait message 0–0000111
XXX=0 (false)
AND
0..0XXX Ending wait
XXX=1 (true)
(b) AND wait signal
Operation
wait message = ~signal message & wait message
if(wait message = 0)
Signal → Releasing the wait state
wait message
0--0000111
signal message
0--0000XXX
Not
X..XXXXX00
XXX=0 (false)
0..0XXX Ending wait
XXX=1 (true)
Waiting for the signal of flag 1, 2, or 3
wait message 0–0100
AND