Available Languages?:

OSA : OS_Bsem_Wait_TO

OS_Bsem_Wait_TO (bsem, timeout)

Allowed only in taskSwitches contextUses timer

Wait for binary semaphore. If timeout expires before semaphore set, then stop waiting with Timeout flag set (see OS_IsTimeout)

Call allowed:

Only in task

Parameters:

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

Returns:

timeout If timeout expired then system service OS_IsTimeout will return true

Example:

void Task (void)
{
    for (;;) {
        /*...*/
        OS_Bsem_Wait_TO(5, 20);  // 20 ticks wait for binary semaphore #5
        if (!OS_IsTimeout()) {
            //
            /*...*/
        }
        /*...*/
    }
}

Old style name

OS_WaitBSemTimeout

See also

 
en/osa/ref/allservices/os_bsem_wait_to.txt · Last modified: 07.10.2010 13:56 (external edit)
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki