xbee communication for UWB quadcopter project Originally by Greg Abdo Forking to reduce impact of interrupt by moving packetbuilder out of the interrupt and letting be handled in the main loop

Fork of com by Prosper Van

queueChar/queueChar.h

Committer:
oprospero
Date:
2014-10-06
Revision:
17:acef0fb07510
Child:
22:0e8e22f161ff

File content as of revision 17:acef0fb07510:

/**************************** queue.h ****************************************/
/*                                                                           */
/*  Authers: Greg Abdo.                                                      */
/*  Date:    February 23, 2013                                               */
/*  Version: 1.0                                                             */
/*                                                                           */
/* The queue is used to stack StructureItem in order with a FILO arrangement.*/
/*****************************************************************************/

#ifndef QUEUECHAR_H
#define QUEUECHAR_H

#include "mbed.h"

using namespace std;

const int MAXQUEUECHARLENGTH = 12;

class queueChar
{
public: 
    queueChar();                        // Queue constructor
    ~queueChar();                       // Queue destructor

    bool isEmpty();                 // Check for an empty queue.
    void clear();                   // Clears the entire queue.
    void add( char );              // Push commandData into the queue.
    char peek();                   // Look at the last item in the queue.
    char pop();                    // Pop the top item off the queue.
    char length();              // Return how many objects are in the queue.

private:
    char buffer[MAXQUEUECHARLENGTH];
    char front;
    char end;
    char lengthVar;
    char nextIndex(char);
    

};

#endif