Aceinna IMU383 Series User Manual page 82

Hide thumbs Also See for IMU383 Series:
Table of Contents

Advertisement

IMU383 Series User's Manual
________________________________________________________________________
* FUNCTION: Initialize - initialize the queue
* ARGUMENTS: queue_ptr is pointer to the queue
*******************************************************************************/
void Initialize(QUEUE_TYPE *queue_ptr)
{
queue_ptr->count = 0;
queue_ptr->front = 0;
queue_ptr->rear = -1;
}
/*******************************************************************************
* FUNCTION: AddQueue - add item in front of queue
* ARGUMENTS: item holds item to be added to queue
*
queue_ptr is pointer to the queue
* RETURNS:
returns 0 if queue is full. 1 if successful
*******************************************************************************/
int AddQueue(char item, QUEUE_TYPE *queue_ptr)
{
int retval = 0;
if(queue_ptr->count >= MAXQUEUE)
{
retval = 0; /* queue is full */
}
else
{
queue_ptr->count++;
queue_ptr->rear = (queue_ptr->rear + 1) % MAXQUEUE;
queue_ptr->entry[queue_ptr->rear] = item;
retval = 1;
}
return retval;
}
/*******************************************************************************
* FUNCTION: DeleteQeue - return an item from the queue
* ARGUMENTS: item will hold item popped from queue
*
queue_ptr is pointer to the queue
* RETURNS:
returns 0 if queue is empty. 1 if successful
*******************************************************************************/
int DeleteQueue(char *item, QUEUE_TYPE *queue_ptr)
{
int retval = 0;
Doc# 7430-1398-01
Downloaded From
Oneyac.com
Page 74

Advertisement

Table of Contents
loading

Related Products for Aceinna IMU383 Series

This manual is also suitable for:

Imu383za seriesImu383za-400

Table of Contents