
[Transition of flags to be waited and event flag image by signals]
Following example explains the state transition of the flags to be
waited and the event flag image when they are signaled by modal type
and pulse type signaling functions.
Parameter flags to be event flag
Function (message) waited image
---------------+---------------+---------------+-------------
os_wait_flg 11111111 11111110 00000001 (*1)
(AND wait) V V
os_sign_flg 00000110 -> 11111000 00000111 (*2)
V V
os_puls_flg 00011000 -> 11100000 00000111 (*3)
V V
os_clar_flg 00000011 -> 11100000 00000100 (*4)
V V
os_sign_flg 01100000 -> 10000000 01100100 (*5)
V V
os_puls_flg 10000000 -> 00000000 01100100 (*6)
V
wake up from suspended state
(*1) - os_wait_flg() specifies to wait for flags 1 to 8 to be all
signaled. However, because the flag 1 in the event flag
image is already set, flag 1 is not accounted as a flag to
be waited for being signaled.
(*2) - Signal the flags 2 and 3 by modal type function
os_sign_flg().
- Waiting state of the flags 2 and 3 are canceled.
- It is registered in the event flag image that flags 2 and 3
are signaled.
(*3) - Signal the flags 4 and 5 by pulse type function
os_puls_flg().
- Waiting state of the flags 4 and 5 are canceled.
- Flags 4 and 5 are not registered in the event flag image.
(*4) - Clear flags 1 and 2 in the event flag image.
- No change in the flags to be waited.
(*5) - Signal the flags 6 and 7 by modal type function
os_sign_flg().
- Waiting state of the flags 6 and 7 are canceled.
- It is registered in the event flag image that flags 6 and 7
are signaled.
(*6) - Signal the flag 8 by pulse type function os_puls_flg().
- Waiting state of the flags 8 is canceled.
- Flag 8 is not registered in the event flag image.
- Because all the flags from 1 to 8 have been signaled and as
a result there are no flags to be waited for being signaled,
suspended task wakes up and starts running.