OS_Bsem_Wait_TO (bsem, timeout)
Wait for binary semaphore. If timeout expires before semaphore set, then stop waiting with Timeout flag set (see OS_IsTimeout)
Only in task
bsem |
Binary semaphore's ID. Number of binary semaphores is set by OS_BSEMS constant in OSAcfg.h |
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_Bsem_Wait_TO(5, 20); // 20 ticks wait for binary semaphore #5 if (!OS_IsTimeout()) { // /*...*/ } /*...*/ } }
OS_WaitBSemTimeout