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: main.cpp
- Revision:
- 16:4f5d20b87dc3
- Parent:
- 15:e3e03a9df89e
- Child:
- 18:e72ee7aed088
- Child:
- 21:c546eab07e28
--- a/main.cpp Thu Apr 10 05:38:45 2014 +0000 +++ b/main.cpp Sat Apr 19 14:39:19 2014 +0000 @@ -143,21 +143,23 @@ // Run GPS handler USB::getSerial().printf("Check GPS\n"); gpsHand.run(); - USB::getSerial().printf("GPS Time: %d\n",DH::Locs().getC().getTime()); + USB::getSerial().printf("GPS Time: %f\n",DH::Locs().getC().getTime()); // Read packet USB::getSerial().printf("Read Input\n"); - PacketStruct* pack=getPS().getNextPacket(); - if(pack!=NULL){ - USB::getSerial().printf("Received Type: %d\n",pack->type); - if(pack->type==PT_REQLOC){ + //PacketStruct* pack=getPS().lastValid;//getPS().getNextPacket(); + //if(pack!=NULL){ + // USB::getSerial().printf("Received Type: %d\n",pack->type); + // if(pack->type==PT_REQLOC){ + if(getPS().outputDevice.readable()>0){ + char input=getPS().outputDevice.getc(); + //if(getPS().outputDevice.getc()=='A'){ // Send location unsigned int sID=getPS().getSuperID(); getPS().sendPacket(0,NULL,0,PT_EMPTY); getPS().sendPacket(sID,NULL,0,PT_SENDLOC); getPS().sendPacket(sID,(char*)(&DH::Locs().getC().getLoc()),sizeof(DataLocation)); getPS().sendPacket(sID,NULL,0,PT_END); - } - delete pack; + //} } } /// Main Loop