bool OS_Csem_Check (csem)
bool OS_Csem_Check_I (csem)
Check if csem's value is non-zero.
OS_ENABLE_CSEM constant must be defined in OSAcfg.h. Size of counting semaphores is defined by OS_CSEM_SIZE constant
csem |
Counting semaphore. Variable of OST_CSEM type |
false |
csem is zero |
true |
csem in not zero |
OST_CSEM csem; void Task (void) { for (;;) { /*...*/ if (OS_Csem_Check (csem)) { // if semaphore is set OS_Csem_Accept(csem); // then accept it /*...*/ } /*...*/ } }
OS_CheckCSem