FreeRTOS + 0/9 examples
CodeScope will show references to xQueueSend 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...

xQueueSend macro

This is a macro that calls xQueueGenericSend(). It is included for backward compatibility with versions of FreeRTOS.org that did not include the xQueueSendToFront() and xQueueSendToBack() macros. It is equivalent to xQueueSendToBack(). Post an item on a queue. The item is queued by copy, not by reference. This function must not be called from an interrupt service routine. See xQueueSendFromISR () for an alternative which may be used in an ISR. Example usage:
struct AMessage { char ucMessageID; char ucData[ 20 ]; } xMessage; uint32_t ulVar = 10UL; void vATask( void *pvParameters ) { QueueHandle_t xQueue1, xQueue2; struct AMessage *pxMessage; // Create a queue capable of containing 10 uint32_t values. xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) ); // 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( xQueue1 != 0 ) { // Send an uint32_t. Wait for 10 ticks for space to become // available if necessary. if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS ) { // Failed to post the message, even after 10 ticks. } } if( xQueue2 != 0 ) { // Send a pointer to a struct AMessage object. Don't block if the // queue is already full. pxMessage = & xMessage; xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 ); } // ... Rest of task code. }

Syntax

#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )

Arguments

xQueue

The handle to the queue on which the item is to be posted.

pvItemToQueue

A pointer to the item that is to be placed on the queue. The size of the items the queue will hold was defined when the queue was created, so this many bytes will be copied from pvItemToQueue into the queue storage area.

xTicksToWait

The maximum amount of time the task should block waiting for space to become available on the queue, should it already be full. The call will return immediately if this is set to 0 and the queue is full. The time is defined in tick periods so the constant portTICK_PERIOD_MS should be used to convert to real time if this is required.

Return value

pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.

Examples

xQueueSend is referenced by 9 libraries and example projects.

References

LocationText
queue.h:479
#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
cmsis_os.c:1084
if (xQueueSend(queue_id, &info, ticks) != pdTRUE) {
cmsis_os.c:1275
if (xQueueSend(queue_id->handle, &mail, 0) != pdTRUE) {