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
Diff: com.h
- Revision:
- 1:4f53de75bc96
- Parent:
- 0:26a151d2c6db
- Child:
- 2:bd1621102cad
--- a/com.h Wed Jan 08 07:32:30 2014 +0000 +++ b/com.h Sat Feb 15 19:54:45 2014 +0000 @@ -20,7 +20,7 @@ #include "PwmIn.h" const int BAUDRATE = 38400; -const int BUFFERSIZE = 10; +const int BUFFERSIZE = 12; class com { @@ -31,18 +31,19 @@ void write( short, short ); // Write to the port. short * read(); // Read from the queue. - private: + private: + Serial xbeeTx; // tx - DIN, rx - DOUT + Serial xbeeRx; // tx - DIN, rx - DOUT + queue *rxBuffer; // queue of commands ready to be read. + PwmIn rssi; + void callback(); // Handle the interrupts. void packetBuilder(); // Called by callback to place commandes into the queue. char buffer[BUFFERSIZE]; // Buffer for holding serial data. int bLength; // Location in the buffer to place next data. int signalStrength; - - Serial xbeeRx; // tx - DIN, rx - DOUT - Serial xbeeTx; // tx - DIN, rx - DOUT - queue *rxBuffer; // queue of commands ready to be read. - PwmIn rssi; + }; #endif \ No newline at end of file