Add xQueueCreateSetStatic method for static allocation of Queue Sets (#1228)

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.
This commit is contained in:
kzorer 2025-01-22 12:23:35 +03:00 committed by GitHub
parent b5d1b972cc
commit 1b8f5965d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 164 additions and 8 deletions

22
queue.c
View file

@ -3186,7 +3186,27 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
return pxQueue;
}
#endif /* configUSE_QUEUE_SETS */
#endif /* #if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) ) */
/*-----------------------------------------------------------*/
#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_xQueueCreateSetStatic( uxEventQueueLength );
pxQueue = xQueueGenericCreateStatic( uxEventQueueLength, ( UBaseType_t ) sizeof( Queue_t * ), pucQueueStorage, pxStaticQueue, queueQUEUE_TYPE_SET );
traceRETURN_xQueueCreateSetStatic( pxQueue );
return pxQueue;
}
#endif /* #if ( ( configUSE_QUEUE_SETS == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) ) */
/*-----------------------------------------------------------*/
#if ( configUSE_QUEUE_SETS == 1 )