mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Kernel changes:
Minor change to xQueueGenericReceive() to catch the extreme case of data being placed into a queue between a task timing out and leaving the xQueueGenericReceive() function. Added xSemaphoreGetCount() macro. Demo app changes: Updated countsem.c to test the new xSemaphoreGetCount() macro.
This commit is contained in:
parent
f81575dcee
commit
b832d5801f
5 changed files with 53 additions and 19 deletions
|
@ -839,6 +839,18 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
|||
*/
|
||||
#define xSemaphoreGetMutexHolder( xSemaphore ) xQueueGetMutexHolder( ( xSemaphore ) )
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* <pre>TaskHandle_t xSemaphoreGetCount( SemaphoreHandle_t xMutex );</pre>
|
||||
*
|
||||
* If the semaphore is a counting semaphore then xSemaphoreGetCount() returns
|
||||
* its current count value. If the semaphore is a binary semaphore then
|
||||
* xSemaphoreGetCount() returns 1 if the semaphore is available, and 0 if the
|
||||
* semaphore is not available.
|
||||
*
|
||||
*/
|
||||
#define xSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
|
||||
#endif /* SEMAPHORE_H */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue