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

Revision:
9:893481b2e488
Parent:
6:71da5b99de97
Child:
10:37ff5b97cf98
--- a/main.cpp	Sun May 05 14:35:25 2013 +0000
+++ b/main.cpp	Sun May 05 17:05:02 2013 +0000
@@ -6,6 +6,7 @@
 
 #include "MODSERIAL.h"
 #include "SDFileSystem.h"      //imported using the import utility    
+#include "SDShell.h"
 
 //general digital I/O specifications for this application
 //SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name);
@@ -43,6 +44,19 @@
 
 volatile int PPSTimeOffset = 0;
 
+// stuff to send the SD file to the PC
+void transferFile()
+{
+    SDShell emulate;
+    emulate.init();
+    
+    trig1led = ppsled = rxMsg = txMsg = 1;
+    while(1)
+    {
+        emulate.shell(toPC, sd, "/sd");
+    }
+}
+
 //////////////////////////////////////////////////////////////////////
 // the below should become classes
 //////////////////////////////////////////////////////////////////////
@@ -378,6 +392,16 @@
             IMURecordCounter = 0;
             detectedGPS1PPS = false;
         }
+        if(get_file_msg)
+        {
+            // stop hardware
+            ADIS_RST = 0;
+            GPS_Reset = 0;
+            // reset the flag
+            get_file_msg = false;
+            // transfer the file
+            transferFile();
+        }
     }
       
     fclose(fpNav);