IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Additional InformationIf the counter of the semaphore is not 0, the counter is decremented and program execution continues. If the counter is0, WaitCSemaTimed() waits until the semaphore is signaled by another task, a timer, or an interrupt handler via a callto OS_SignalCSema(). The counter is then decremented and program execution continues. If the semaphore was notsignaled within the specified time, the program execution continues but returns a value of 0. An unlimited number oftasks can wait for a semaphore. According to the rules of the scheduler, of all the tasks waiting for the semaphore, thetask with the highest priority will continue program execution.ImportantThis function may not be called from within an interrupt handler.OS_CSemaRequest()DescriptionDecrements the counter of a semaphore, if it is signaled.Prototypechar OS_CSemaRequest (OS_CSEMA* pCSema);ParameterDescriptionpCSemaPointer to a data structure of type OS_CSEMA.Table 55: OS_GetCSemaRequest() parameter listReturn value0: Failed, semaphore was not signaled.1: OK, semaphore was available and counter was decremented once.Additional informationIf the counter of the semaphore is not 0, the counter is decremented and program execution continues. If the counter is0, OS_CSemaRequest() does not wait and does not modify the semaphore counter. The function returns with errorstate. Because this function never blocks a calling task, this function may be called from an interrupt handler.OS_GetCSemaValue()DescriptionReturns the counter value of a specified semaphore.Prototypeint OS_GetCSemaValue (OS_SEMA* pCSema);ParameterDescriptionpCSemaTable 56: OS_GetCSemaValue() parameter listReturn valueThe counter value of the semaphore.OS_SetCSemaValue()DescriptionSets the counter value of a specified semaphore.PrototypePointer to a data structure of type OS_CSEMA.int OS_SetCSemaValue (OS_SEMA* pCSema,OS_UINT Value);ParameterDescriptionpCSemaTable 57: OS_SetCSemaValue() parameter listPointer to a data structure of type OS_CSEMA.58<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2