FreeRTOS + 0/9 examples
CodeScope will show references to xQueueCreate from the following samples and libraries:
Examples
STM32446E_EVAL
Applications
FreeRTOS
STM32469I-Discovery
Applications
FreeRTOS
STM32469I_EVAL
Applications
FreeRTOS
STM324x9I_EVAL
Applications
FreeRTOS
STM324xG_EVAL
Applications
FreeRTOS
STM32F412G-Discovery
Applications
FreeRTOS
STM32F413H-Discovery
Applications
FreeRTOS
STM32F413ZH-Nucleo
Applications
FreeRTOS
STM32F429I-Discovery
Applications
FreeRTOS
 
Symbols
loading...
Files
loading...

xQueueCreate macro

Creates a new queue instance, and returns a handle by which the new queue can be referenced. Internally, within the FreeRTOS implementation, queues use two blocks of memory. The first block is used to hold the queue's data structures. The second block is used to hold items placed into the queue. If a queue is created using xQueueCreate() then both blocks of memory are automatically dynamically allocated inside the xQueueCreate() function. (see http://www.freertos.org/a00111.html). If a queue is created using xQueueCreateStatic() then the application writer must provide the memory that will get used by the queue. xQueueCreateStatic() therefore allows a queue to be created without using any dynamic memory allocation. http://www.FreeRTOS.org/Embedded-RTOS-Queues.html Example usage:
struct AMessage { char ucMessageID; char ucData[ 20 ]; }; void vATask( void *pvParameters ) { QueueHandle_t xQueue1, xQueue2; // Create a queue capable of containing 10 uint32_t values. xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); if( xQueue1 == 0 ) { // Queue was not created and must not be used. } // Create a queue capable of containing 10 pointers to AMessage structures. // These should be passed by pointer as they contain a lot of data. xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) ); if( xQueue2 == 0 ) { // Queue was not created and must not be used. } // ... Rest of task code. }

Syntax

#define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )

Arguments

uxQueueLength

The maximum number of items that the queue can contain.

uxItemSize

The number of bytes each item in the queue will require. Items are queued by copy, not by reference, so this is the number of bytes that will be copied for each posted item. Each item on the queue must be the same size.

Return value

If the queue is successfully create then a handle to the newly created queue is returned. If the queue cannot be created then 0 is returned.

Examples

xQueueCreate is referenced by 9 libraries and example projects.

References

LocationText
queue.h:146
#define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )
cmsis_os.c:1055
return xQueueCreate(queue_def->queue_sz, queue_def->item_sz);
cmsis_os.c:1185
(*(queue_def->cb))->handle = xQueueCreate(queue_def->queue_sz, sizeof(void *));
timers.c:966
xTimerQueue = xQueueCreate( ( UBaseType_t ) configTIMER_QUEUE_LENGTH, sizeof( DaemonTaskMessage_t ) );