From c61877136445b415259d42491c82c60f045b56e3 Mon Sep 17 00:00:00 2001 From: kzorer Date: Tue, 21 Jan 2025 23:09:45 +0300 Subject: [PATCH] - 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. --- queue.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/queue.c b/queue.c index 4759b439b..4ad7db1e5 100644 --- a/queue.c +++ b/queue.c @@ -3189,6 +3189,24 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) #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 ) BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,