this version has all of Jim's fixes for reading the GPS and IMU data synchronously
Dependencies: MODSERIAL SDFileSystem mbed SDShell CRC CommHandler FP LinkedList LogUtil
Diff: main.cpp
- Revision:
- 17:71900da6ced6
- Parent:
- 16:2aea22130ba1
- Child:
- 18:111025f447d8
diff -r 2aea22130ba1 -r 71900da6ced6 main.cpp --- a/main.cpp Wed May 08 06:22:57 2013 +0000 +++ b/main.cpp Thu May 09 16:06:45 2013 +0000 @@ -61,11 +61,14 @@ ADIS_RST = 0; // same here wait(0.01f); // just make sure that the hardware has time to stop trig1led = ppsled = rxMsg = txMsg = 1; // just indicate that we're in here - toPC.attach(NULL); // incase the PC serial was using an interrupt handler for RX + //toPC.attach(NULL); // incase the PC serial was using an interrupt handler for RX fflush(stdout); // and clear any TX reminants toPC.printf("Entering Shell Emulator...\n"); // just for fluf wait(0.1f); // no reason for this either emulate.shell(toPC, sd, "/sd"); // now the SDShell object will serve SD files via UNIX commands + + toPC.printf(" normal termination of single mission \n"); + wait(0.1f); } //ISR for detection of the GPS 1PPS @@ -246,10 +249,13 @@ Timer triggerInterval; //while(PPSCounter < 300) + + bool newMission = true; + /////////////////////////////////////////////////////////////////////////// - // top of the while loop + // top of the mission while loop /////////////////////////////////////////////////////////////////////////// - while(1) + while(newMission) { //read the USB serial data from the PC to check for commands @@ -402,16 +408,15 @@ } } - if (fpNav != NULL) fclose(fpNav); //insurance - transferFile(); - // to exit this function the HOST (ie: computer or PC app) must send "exit" otherwise the mbed will act - // like a terminal and serve SD file data forever + + if (fpNav != NULL) fclose(fpNav); //insurance + transferFile(); + // to exit this function the HOST (ie: computer or PC app) must send "exit" otherwise the mbed will act + // like a terminal and serve SD file data forever - - - - - toPC.printf(" normal termination \n"); + toPC.printf(" normal termination of single mission \n"); + + NVIC_SystemReset(); /* //at this point we have terminated the dat collection and we need to send the stored nav file to the PC