Changes to allow hardware camera trigger

Dependencies:   mbed

Fork of GPS_Incremental by james kain

Revision:
7:1730ee31d181
Parent:
6:2a8486283198
--- a/PCMessaging.h	Tue Apr 02 15:22:37 2013 +0000
+++ b/PCMessaging.h	Wed Apr 17 20:21:58 2013 +0000
@@ -8,6 +8,7 @@
 const unsigned char  STOPSTREAM_MSG     =5;
 const unsigned char  STARTLOGINFO_MSG   =6;
 const unsigned char  STOPLOGINFO_MSG    =7;
+const unsigned char  SEND_CAMTRG_MSG    =8;
 
 const double  DEGREES_TO_RADIANS = acos(-1.0)/180.0;
 const double eccen          = 0.0818191908426;  //WGS84 earth eccentricity
@@ -25,9 +26,10 @@
 bool logMsgInfo     =false;
 bool sendLogMsgInfo =false;
 bool recordData     =false;
+bool camtrg         =false;
 
 
-const unsigned char numMessages = 8;    //number of potential messages
+const unsigned char numMessages = 9;    //number of potential messages
 char msgList[numMessages][32];          //text array storing the command messages from the PC
 char minMessageSize = 10;               //minimum size of a text message
 unsigned char CR = 0x0d;                //ASCII Carriage Return
@@ -44,6 +46,7 @@
     sprintf(msgList[STOPSTREAM_MSG],    "WMsg POSSTREAM N");
     sprintf(msgList[STARTLOGINFO_MSG],  "WMsg LOGINFO Y");
     sprintf(msgList[STOPLOGINFO_MSG],   "WMsg LOGINFO N");
+    sprintf(msgList[SEND_CAMTRG_MSG],   "WMsg SENDTRIG");
     //message length is from 10 to 16 chars
     
     toPC.printf(" finished setting up messages \n");
@@ -114,6 +117,9 @@
                     case STOPLOGINFO_MSG:
                         logMsgInfo = (m == STARTLOGINFO_MSG);
                         sendLogMsgInfo = true;
+                    break; 
+                    case SEND_CAMTRG_MSG:
+                        camtrg = true;
                     break;  
                 }  //end Switch statement
                 break;
@@ -225,6 +231,12 @@
                          solReady
                          );
         }
+        if (camtrg)  //send the status message to the PC
+        {
+            camtrg=false;
+            camera1EventDetected = true;  //reset to false in main after processing the image detection
+            toPC.printf("WMsg STATUS CAMTRG received\n");
+        }
         
         //should just record ALL the data -- can pick over it in the post-processing
         if (sendRecData)  //begin to (or stop) record the serial data