Espressif ESP32-S2 Programming Manual page 906

Table of Contents

Advertisement

Chapter 2. API Reference
} xMessage;
uint32_t ulVar
void vATask( void *pvParameters )
{
QueueHandle_t xQueue1, xQueue2;
struct AMessage *pxMessage;
//
Create a queue capable of containing
xQueue1
=
xQueueCreate( 10, sizeof( uint32_t ) );
//
Create a queue capable of containing
//
These should be passed by pointer
xQueue2
=
xQueueCreate( 10, sizeof( struct AMessage
// ...
if( xQueue1
!=
{
//
Send an
//
available
if( xQueueSendToBack( xQueue1, ( void
pdPASS )
{
//
Failed to post the message, even after
}
}
if( xQueue2
!=
{
//
Send a pointer to a struct AMessage
//
queue
is
pxMessage
xQueueSendToBack( xQueue2, ( void
}
// ...
Rest of task
}
Return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
Parameters
• 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.
xQueueSend(xQueue, pvItemToQueue, xTicksToWait)
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 equiv-
alent 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:
Espressif Systems
=
10UL;
0
)
uint32_t.
Wait
for
if
necessary.
0
)
already
full.
= &
xMessage;
code.
Submit Document Feedback
10
uint32_t
values.
10
pointers to AMessage
as
they contain a lot of
*
10
ticks
for
space to become
*
) &ulVar, ( TickType_t )
10
ticks.
object.
Don't block if the
*
) &pxMessage, ( TickType_t )
895
(continued from previous page)
structures.
data.
) );
10
)
0
);
Release v4.4
!=␣

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF