Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of dgps by
Diff: packet.h
- Revision:
- 16:4f5d20b87dc3
- Parent:
- 15:e3e03a9df89e
- Child:
- 18:e72ee7aed088
diff -r e3e03a9df89e -r 4f5d20b87dc3 packet.h --- a/packet.h Thu Apr 10 05:38:45 2014 +0000 +++ b/packet.h Sat Apr 19 14:39:19 2014 +0000 @@ -36,7 +36,10 @@ #else USB::getSerial() #endif - ),next(NULL){} + ),next(NULL){ + //outputDevice.attach(this,&PacketSender::handleUpdate,Serial::RxIrq); + lastValid=NULL; + } Serial& outputDevice; void sendPacket(PacketStruct& output){ for(int a=0;a<sizeof(PacketStruct);a++){ @@ -74,6 +77,13 @@ sendPacket(output); } } + PacketStruct* lastValid; + bool found; + void handleUpdate(){ + USB::getSerial().printf("Interupt\n"); + PacketStruct* next = getNextPacket(); + if(next!=NULL){lastValid=next;} + } // Number of consecutive zeros unsigned int numZeros; @@ -106,7 +116,7 @@ if(nextValid==sizeof(PacketStruct))break; // Read in next char char input=outputDevice.getc(); - //USB::getSerial().printf("Read ByteC %X %X\n",nextValid,input); + USB::getSerial().printf("Read ByteC %X %X\n",nextValid,input); // Check for valid char if(resetCheck(input)){resetPacket=true;break;} // Set char