mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
- Add xQueueCreateSetStatic method for static allocation of Queue Sets
This commit introduces the xQueueCreateSetStatic function, which allows for the static allocation of Queue Sets in FreeRTOS when both configUSE_QUEUE_SETS and configSUPPORT_STATIC_ALLOCATION are enabled. Changes: - Implemented xQueueCreateSetStatic function. - Updated kernel to support static queue set creation.
This commit is contained in:
parent
b5d1b972cc
commit
c618771364
18
queue.c
18
queue.c
|
@ -3189,6 +3189,24 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
||||||
#endif /* configUSE_QUEUE_SETS */
|
#endif /* configUSE_QUEUE_SETS */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
|
||||||
|
|
||||||
|
QueueSetHandle_t xQueueCreateSetStatic( const UBaseType_t uxEventQueueLength, uint8_t * pucQueueStorage, StaticQueue_t * pxStaticQueue)
|
||||||
|
{
|
||||||
|
QueueSetHandle_t pxQueue;
|
||||||
|
|
||||||
|
traceENTER_xQueueCreateSet( uxEventQueueLength );
|
||||||
|
|
||||||
|
pxQueue = xQueueGenericCreateStatic( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), pucQueueStorage, pxStaticQueue, queueQUEUE_TYPE_SET );
|
||||||
|
|
||||||
|
traceRETURN_xQueueCreateSet( pxQueue );
|
||||||
|
|
||||||
|
return pxQueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* configUSE_QUEUE_SETS */
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( configUSE_QUEUE_SETS == 1 )
|
#if ( configUSE_QUEUE_SETS == 1 )
|
||||||
|
|
||||||
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||||
|
|
Loading…
Reference in a new issue