OS_Flag_Wait_On_TO (flags, mask, timeout)
Wait for any mask bits in flags to be set. If timeout expires before event occurs, then stop waiting with Timeout flag set (see OS_IsTimeout)
Only in task
flags |
Variable of OST_FLAGx (x = 8, 16, 32) type |
mask |
Bit mask to operate on |
timeout |
Time of waiting in system ticks - calling OS_Timer periods |
timeout |
If timeout expired then system service OS_IsTimeout will return true |
OST_FLAG flag; void Task (void) { for (;;) { /*...*/ OS_Flag_Wait_On_TO (flag, 0x06, 10); // wait 10 ticks bit 1 or 2 to be set if (!OS_IsTimeout()) { // /*...*/ } /*...*/ } }
OS_WaitAnyFlagTimeout
OS_Flag_Wait_On