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:
7:1bec23c68a3c
Parent:
6:71da5b99de97
Child:
12:c2f60b3ceb74
--- a/PCMessaging.h	Sun May 05 14:35:25 2013 +0000
+++ b/PCMessaging.h	Mon May 06 01:37:38 2013 +0000
@@ -9,6 +9,7 @@
 const unsigned char  STOPSTREAM_MSG     =6;
 const unsigned char  STARTLOGINFO_MSG   =7;
 const unsigned char  STOPLOGINFO_MSG    =8;
+const unsigned char  GETFILE_MSG        =9;
 
 const double  DEGREES_TO_RADIANS = acos(-1.0)/180.0;
 const double eccen          = 0.0818191908426;  //WGS84 earth eccentricity
@@ -28,9 +29,10 @@
 bool sendLogMsgInfo =false;
 bool recordData     =false;
 bool fireTrigger    =false;
+bool get_file_msg   =false;
 
 
-const unsigned char numMessages = 9;    //number of potential messages
+const unsigned char numMessages = 10;    //number of potential messages
 char msgList[numMessages][32];          //text array storing the command messages from the PC
 char minMessageSize = 11;               //minimum size of a text message
 unsigned char CR = 0x0d;                //ASCII Carriage Return
@@ -51,6 +53,7 @@
     sprintf(msgList[STARTLOGINFO_MSG],  "WMsg LOGINFO Y");
     sprintf(msgList[STOPLOGINFO_MSG],   "WMsg LOGINFO N");
     sprintf(msgList[FIRE_TRIGGER_MSG],  "WMsg TRIGGER");
+    sprintf(msgList[GETFILE_MSG],       "WMsg GETFILE");
     //message length is from 10 to 16 chars
     
  //   toPC.printf(" finished setting up messages \n");
@@ -126,33 +129,44 @@
                 {
                     case STATUS_MSG:
                         sendStatus = true;  //send a status message back to PC
-                    break;
+                        break;
+                        
                     case POSVEL_MSG:
                         sendPosVel = true;  //send a posvel message back to PC
                         timeFromPosVelMessageReceipt.reset();  //start time and close SD card file if too long
-                    break;
+                        break;
+                    
                     case STARTDATA_MSG:  //start the data recording to the SD card
                         recordData = true;
                         sendRecData = true;
                         break;
+                    
                     case STOPDATA_MSG:   //stop the data recording to the SD card
                         recordData = false;
                         sendRecData = true;
                         break;
+                    
                     case STARTSTREAM_MSG:
                     case STOPSTREAM_MSG:
                         streamPos = (m == STARTSTREAM_MSG);
                         sendStreamPos = true;
-                    break;
+                        break;
+                    
                     case STARTLOGINFO_MSG:
                     case STOPLOGINFO_MSG:
                         logMsgInfo = (m == STARTLOGINFO_MSG);
                         sendLogMsgInfo = true;
-                    break;  
+                        break;  
+                    
                     case FIRE_TRIGGER_MSG:
                         fireTrigger = true;
                         toPC.printf("MBED received trigger command \n");
-                    break;
+                        break;
+                    
+                    case GETFILE_MSG:
+                        get_file_msg = true;
+                        break;
+                    
                 }  //end Switch statement
                 break;
             } //end test for a valid message