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.cpp
- Revision:
- 11:d1f488302d06
- Parent:
- 10:ec36e1b59a39
- Child:
- 12:bf4642578682
--- a/com.cpp Fri Apr 25 06:14:36 2014 +0000 +++ b/com.cpp Fri Apr 25 06:21:19 2014 +0000 @@ -102,14 +102,14 @@ void com::ackCheck() { - __disable_irq(); if( !txBuffer->isEmpty() && xbeeTx.writeable()) { + __disable_irq(); short * pkt = txBuffer->pop(); write(pkt[0],pkt[1]); //may need to disable interrupt delete[] pkt; + __enable_irq(); } - __enable_irq(); } bool com::rdy2ack()