OS_Wait_TO (condition, timeout)
Wait until condition is true. If timeout expires before this event occurs, then stop waiting with Timeout flag set (see OS_IsTimeout)
Only in task
condition |
Any boolean expression |
timeout |
Time of waiting in system ticks - calling OS_Timer periods |
timeout |
If timeout expired then system service OS_IsTimeout will return true |
void Task (void) { for (;;) { /*...*/ OS_Wait_TO(RB1 == 1, 50); // Wait 50 ticks for RB1 == 1 if (!OS_IsTimeout()) { // /*...*/ } /*...*/ } }
OS_WaitConditionTimeout
OS_Cond_Wait_TO