Command disabled: backlink
 
Available Languages?:

OSA : OS_Bsem_Check

OST_WORD OS_Bsem_Check (bsem)
OST_WORD bool OS_Bsem_Check_I (bsem)

Check if binary semaphore is set. Returns value of type OST_WORD.

Call allowed:

Everywhere

Parameters:

bsem Binary semaphore's ID. Number of binary semaphores is set by OS_BSEMS constant in OSAcfg.h

Returns:

==0 Semaphore is not set
!=0 Semaphore is set

Example:

#define BS_DATA_RECEIVED  3
 
void Task (void)
{
    for (;;) {
        /*...*/
        // Is semaphore set by other task?
        if (OS_Bsem_Check(BS_DATA_RECEIVED)) {
            // Work with received data
            /*...*/
        }
        /*...*/
    }
}

Old style name

OS_CheckBSem

See also

 
en/osa/ref/allservices/os_bsem_check.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