OSA : OS_Bsem_Switch

OS_Bsem_Switch (bsem)
OS_Bsem_Switch_I (bsem)

Switches binary semaphore to other state ("0"→"1" or "1"→"0").

Call allowed:

Everywhere

Parameters:

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

Returns:

nothing

Example:

void Task (void)
{
    for (;;) {
        /*...*/
        OS_Bsem_Switch(3);  // Change state of binary semaphore #3
        /*...*/
    }
}

Old style name

See also