mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
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:
parent
b5d1b972cc
commit
1b8f5965d3
7 changed files with 164 additions and 8 deletions
22
queue.c
22
queue.c
|
@ -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 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue