ACS ACR89U-A1 User Manual Page 55

  • Download
  • Add to my manuals
  • Print
  • Page
    / 78
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 54
ACR89U-A1 Application Programming Interface info@acs.com.hk
Version 1.01
www.acs.com.hk
Page 55 of 78
Parameters:
xQueue [in] The handle to the queue on which the item is to be posted.
pvItemToQueue [in] 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 [in] 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. The time is defined in tick periods so the constant
portTICK_RATE_MS should be used to convert to real time if this is required.
Specifying the block time as portMAX_DELAY will cause the task to block
indefinitely (without a timeout).
Returns:
portBASE_TYPE pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
Example:
struct AMessage
{
portCHAR ucMessageID;
portCHAR ucData[ 20 ];
} xMessage;
unsigned portLONG ulVar = 10UL;
void vATask( void *pvParameters )
{
xQueueHandle xQueue1, xQueue2;
struct AMessage *pxMessage;
// Create a queue capable of containing 10 unsigned long values.
xQueue1 = xQueueCreate( 10, sizeof( unsigned portLONG ) );
// 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 unsigned long. Wait for 10 ticks for space to become
// available if necessary.
if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( portTickType
) 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.
Page view 54
1 2 ... 50 51 52 53 54 55 56 57 58 59 60 ... 77 78

Comments to this Manuals

No comments