Document Title Here
Document Title Here
Document Title Here
ACR89U-A1 Application Programming Interface
Version 1.00
Page 95 of 115
info@acs.com.hk
www.acs.com.hk
6.6.5. xSemaphoreTake
This is a macro to obtain a semaphore. The semaphore must have previously been created with a call
to vSemaphoreCreateBinary(), xSemaphoreCreateMutex() or xSemaphoreCreateCounting().
[semphr.h]
signed portBASE_TYPE xSemaphoreTake
(
xSemaphoreHandle xSemaphore,
portTickType xBlockTime
);
Parameters:
xSemaphore
[in] A handle to the semaphore being taken - obtained when the semaphore was
created.
xBlockTime
[in] The time in ticks to wait for the semaphore to become available. The macro
portTICK_RATE_MS can be used to convert this to a real time. A block time of zero
can be used to poll the semaphore. Specifying the block time as portMAX_DELAY
will cause the task to block indefinitely (without a timeout).
Returns:
signed portBASE_TYPE
pdTRUE if the semaphore was obtained. pdFALSE if xBlockTime expired without the
semaphore becoming available.
Comments to this Manuals