Chapter 2. API Reference
taskYIELD_YIELD_FROM_ISR();
}
}
Return pdTRUE if the data was successfully sent to the queue, 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.
• [out] pxHigherPriorityTaskWoken: xQueueGenericSendFromISR() will set *pxHigh-
erPriorityTaskWoken to pdTRUE if sending to the queue caused a task to unblock, and the un-
blocked task has a priority higher than the currently running task. If xQueueGenericSendFromISR()
sets this value to pdTRUE then a context switch should be requested before the interrupt is exited.
• xCopyPosition: Can take the value queueSEND_TO_BACK to place the item at the back of
the queue, or queueSEND_TO_FRONT to place the item at the front of the queue (for high priority
messages).
BaseType_t
xQueueGiveFromISR(QueueHandle_t
BaseType_t
xQueueReceiveFromISR(QueueHandle_t
Receive an item from a queue. It is safe to use this function from within an interrupt service routine.
Example usage:
QueueHandle_t xQueue;
//
Function to create a queue
void vAFunction( void *pvParameters )
{
char cValueToPost;
const TickType_t xTicksToWait
//
Create a queue capable of containing
xQueue
=
xQueueCreate( 10, sizeof( char ) );
if( xQueue
==
{
//
Failed to create the
}
// ...
//
Post some characters that will be used within an
//
is
full then this task will block
cValueToPost
=
xQueueSend( xQueue, ( void
cValueToPost
=
xQueueSend( xQueue, ( void
// ...
keep posting characters
//
becomes
full.
cValueToPost
=
xQueueSend( xQueue, ( void
}
//
ISR that outputs
void vISR_Routine( void )
{
Espressif Systems
TaskWoken)
*const pxHigherPriorityTaskWoken)
and
post some
=
( TickType_t )0xff;
0
)
queue.
'a';
*
) &cValueToPost, xTicksToWait );
'b';
*
) &cValueToPost, xTicksToWait );
...
'c';
*
) &cValueToPost, xTicksToWait );
all
the characters received on the
Submit Document Feedback
xQueue, BaseType_t *const pxHigherPriority-
xQueue, void *const pvBuffer, BaseType_t
values.
10
characters.
ISR.
for
xTicksToWait
this task may block when the queue
888
(continued from previous page)
If the queue
ticks.
queue.
(continues on next page)
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?