Renesas M3T-MR100 Network Card User Manual


 
- 46 -
Figure 4.13 shows an example of task execution control by
the eventflag using the wai_flg and set_flg service calls.
The eventflag has a feature that it can wake up multiple tasks collectively at a time.
In Figure 4.13, there are six tasks linked one to another, task A to task F. When the flag pattern is set to 0xF by the set_flg
service call, t
he tasks that meet the wait conditions are removed sequentially from the top of the queue. In this diagram, the
tasks that meet the wait conditions are task A, task C, and task E. Out of these tasks, task A, task C, and task E are removed
from the queue.
If this event flag has a TA_CLR attribute, when the waiting of Task A is canceled, the bit pattern of the event flag will be
set to 0, and Task C and Task E will not be removed from queue.
TaskF TaskD
TaskB
Flag pattern
0x0F
Flag pattern
0
Flag queue TaskA TaskB TaskC
TaskD
TaskE
TaskF
0xFF
AND
0x0F
AND
0xFF
AND
0xFF
OR
0x10
OR
0x0F
OR
Wait pattern
Wait mode
set_flg
Figure 4.13 Task Execution Control by the Eventflag