mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-28 21:33:32 +00:00
freertos: Add GetStaticBuffer functions
This commit adds the various ...GetStaticBuffer() functions from upstream FreeRTOS. See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/641 for more details.
This commit is contained in:
@@ -1170,4 +1170,25 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||
*/
|
||||
#define uxSemaphoreGetCount( xSemaphore ) uxQueueMessagesWaiting( ( QueueHandle_t ) ( xSemaphore ) )
|
||||
|
||||
/**
|
||||
* semphr.h
|
||||
* @code{c}
|
||||
* BaseType_t xSemaphoreGetStaticBuffer( SemaphoreHandle_t xSemaphore );
|
||||
* @endcode
|
||||
*
|
||||
* Retrieve pointer to a statically created binary semaphore, counting semaphore,
|
||||
* or mutex semaphore's data structure buffer. This is the same buffer that is
|
||||
* supplied at the time of creation.
|
||||
*
|
||||
* @param xSemaphore The semaphore for which to retrieve the buffer.
|
||||
*
|
||||
* @param ppxSemaphoreBuffer Used to return a pointer to the semaphore's
|
||||
* data structure buffer.
|
||||
*
|
||||
* @return pdTRUE if buffer was retrieved, pdFALSE otherwise.
|
||||
*/
|
||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
#define xSemaphoreGetStaticBuffer( xSemaphore, ppxSemaphoreBuffer ) xQueueGenericGetStaticBuffers( ( QueueHandle_t ) ( xSemaphore ), NULL, ( ppxSemaphoreBuffer ) )
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
|
||||
#endif /* SEMAPHORE_H */
|
||||
|
Reference in New Issue
Block a user