OSA : OS_Flag_Wait_AllOn_TO

OS_Flag_Wait_AllOn_TO (flags, mask, timeout)

Allowed only in taskSwitches contextUses timer

Wait for all mask bits in flags to be set. If timeout expires before event occurs, then stop waiting with Timeout flag set (see OS_IsTimeout)

Call allowed:

Only in task

Parameters:

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

Returns:

timeout If timeout expired then system service OS_IsTimeout will return true

Example:

OST_FLAG flag;
 
void Task (void)
{
    for (;;) {
        /*...*/
        OS_Flag_Wait_AllOn_TO (flag, 0x14, 100); // wait 100 ticks for bits 4 and 2
                                                 // to be set
        if (!OS_IsTimeout()) {
            //
            /*...*/
        }
        /*...*/
    }
}

Old style name

OS_WaitAllFlagTimeout

OS_Flag_Wait_AllOn

See also