Available Languages?:

OSA : OS_Csem_SetValue

OS_Csem_SetValue (csem, value)
OS_Csem_SetValue_I (csem, value)

Set counting semaphore's value to value.

OS_ENABLE_CSEM constant must be defined in OSAcfg.h. Size of counting semaphores is defined by OS_CSEM_SIZE constant

For PIC16, counting semaphores can only be allocated in bank0 or bank1

Call allowed:

Parameters:

csem Counting semaphore. Variable of OST_CSEM type
value Init value of counting semaphore.

Returns:

nothing

Example:

OST_CSEM csem;
 
void Task (void)
{
    for (;;) {
        /*...*/
        OS_Csem_SetValue (csem, 15);
        // Now csem = 15
        /*...*/
    }
}

Old style name

OS_SetCSemValue

See also

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