- 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:
kzorer 2025-01-21 23:09:45 +03:00
parent b5d1b972cc
commit c618771364

18
queue.c
View file

@ -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,