queue. h
const void * pvItemToQueue
);
long BaseType_t
Definition portmacro.h:59
struct QueueDefinition * QueueHandle_t
Definition queue.h:51
#define xQueueOverwrite(xQueue, pvItemToQueue)
Definition queue.h:597
Only for use with queues that have a length of one - so the queue is either empty or full.
Post an item on a queue. If the queue is already full then overwrite the value held in the queue. The item is queued by copy, not by reference.
This function must not be called from an interrupt service routine. See xQueueOverwriteFromISR () for an alternative which may be used in an ISR.
- Parameters
-
xQueue | The handle of the queue to which the data is being sent. |
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. |
- Returns
- xQueueOverwrite() is a macro that calls xQueueGenericSend(), and therefore has the same return values as xQueueSendToFront(). However, pdPASS is the only value that can be returned because xQueueOverwrite() will write to the queue even when the queue is already full.
Example usage:
void vFunction( void *pvParameters )
{
uint32_t ulVarToSend, ulValReceived;
xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
ulVarToSend = 10;
ulValReceived = 0;
if( ulValReceived != 10 )
{
}
ulVarToSend = 100;
if( ulValReceived != 100 )
{
}
}
BaseType_t xQueuePeek(QueueHandle_t xQueue, void *const pvBuffer, TickType_t xTicksToWait)
Definition queue.c:1877
BaseType_t xQueueReceive(QueueHandle_t xQueue, void *const pvBuffer, TickType_t xTicksToWait)
Definition queue.c:1502