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

Committer:
jekain314
Date:
Tue Apr 30 19:59:43 2013 +0000
Revision:
1:8e24e633f8d8
Parent:
0:432b860b6ff7
Child:
2:7039be3daf6e
Jim's version dated 30-apr-13

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jekain314 0:432b860b6ff7 1 //these are defines for the messages that are sent from the PC across the USB
jekain314 0:432b860b6ff7 2 //these messages produce reactions on the mbed
jekain314 0:432b860b6ff7 3 const unsigned char STATUS_MSG =0;
jekain314 0:432b860b6ff7 4 const unsigned char POSVEL_MSG =1;
jekain314 0:432b860b6ff7 5 const unsigned char STARTDATA_MSG =2;
jekain314 0:432b860b6ff7 6 const unsigned char STOPDATA_MSG =3;
jekain314 0:432b860b6ff7 7 const unsigned char STARTSTREAM_MSG =4;
jekain314 0:432b860b6ff7 8 const unsigned char STOPSTREAM_MSG =5;
jekain314 0:432b860b6ff7 9 const unsigned char STARTLOGINFO_MSG =6;
jekain314 0:432b860b6ff7 10 const unsigned char STOPLOGINFO_MSG =7;
jekain314 1:8e24e633f8d8 11 const unsigned char FIRE_TRIGGER_MSG =8;
jekain314 0:432b860b6ff7 12
jekain314 0:432b860b6ff7 13 const double DEGREES_TO_RADIANS = acos(-1.0)/180.0;
jekain314 0:432b860b6ff7 14 const double eccen = 0.0818191908426; //WGS84 earth eccentricity
jekain314 0:432b860b6ff7 15 const double earthRadius = 6378137; //WGS84 earthRadius in meters
jekain314 0:432b860b6ff7 16
jekain314 1:8e24e633f8d8 17 const unsigned short serBuffMax = 1024;
jekain314 1:8e24e633f8d8 18 char serBuf[serBuffMax];
jekain314 0:432b860b6ff7 19 int serBufChars=0;
jekain314 0:432b860b6ff7 20
jekain314 0:432b860b6ff7 21 //flags to control the PC command actions
jekain314 0:432b860b6ff7 22 bool sendPosVel =false;
jekain314 0:432b860b6ff7 23 bool sendStatus =false;
jekain314 0:432b860b6ff7 24 bool sendRecData =false;
jekain314 0:432b860b6ff7 25 bool streamPos =false;
jekain314 0:432b860b6ff7 26 bool sendStreamPos =false;
jekain314 0:432b860b6ff7 27 bool logMsgInfo =false;
jekain314 0:432b860b6ff7 28 bool sendLogMsgInfo =false;
jekain314 0:432b860b6ff7 29 bool recordData =false;
jekain314 1:8e24e633f8d8 30 bool fireTrigger =false;
jekain314 0:432b860b6ff7 31
jekain314 0:432b860b6ff7 32
jekain314 1:8e24e633f8d8 33 const unsigned char numMessages = 9; //number of potential messages
jekain314 0:432b860b6ff7 34 char msgList[numMessages][32]; //text array storing the command messages from the PC
jekain314 0:432b860b6ff7 35 char minMessageSize = 11; //minimum size of a text message
jekain314 0:432b860b6ff7 36 unsigned char CR = 0x0d; //ASCII Carriage Return
jekain314 0:432b860b6ff7 37 unsigned char LF = 0x0a; //ASCII Line Feed
jekain314 0:432b860b6ff7 38
jekain314 0:432b860b6ff7 39 void setUpMessages(void)
jekain314 0:432b860b6ff7 40 {
jekain314 0:432b860b6ff7 41 //set up the ASCII text records that are candidates to be passed from the PC
jekain314 0:432b860b6ff7 42 sprintf(msgList[STATUS_MSG], "WMsg STATUS");
jekain314 0:432b860b6ff7 43 sprintf(msgList[POSVEL_MSG], "WMsg POSVEL");
jekain314 0:432b860b6ff7 44 sprintf(msgList[STARTDATA_MSG], "WMsg RECORDDATA Y");
jekain314 0:432b860b6ff7 45 sprintf(msgList[STOPDATA_MSG], "WMsg RECORDDATA N");
jekain314 0:432b860b6ff7 46 sprintf(msgList[STARTSTREAM_MSG], "WMsg POSSTREAM Y");
jekain314 0:432b860b6ff7 47 sprintf(msgList[STOPSTREAM_MSG], "WMsg POSSTREAM N");
jekain314 0:432b860b6ff7 48 sprintf(msgList[STARTLOGINFO_MSG], "WMsg LOGINFO Y");
jekain314 0:432b860b6ff7 49 sprintf(msgList[STOPLOGINFO_MSG], "WMsg LOGINFO N");
jekain314 1:8e24e633f8d8 50 sprintf(msgList[FIRE_TRIGGER_MSG], "WMsg TRIGGER");
jekain314 0:432b860b6ff7 51 //message length is from 10 to 16 chars
jekain314 0:432b860b6ff7 52
jekain314 0:432b860b6ff7 53 toPC.printf(" finished setting up messages \n");
jekain314 0:432b860b6ff7 54 }
jekain314 0:432b860b6ff7 55
jekain314 0:432b860b6ff7 56 void readFromPC()
jekain314 0:432b860b6ff7 57 {
jekain314 0:432b860b6ff7 58 //The received commands only occur at the initialization stage -- time is not that critical there.
jekain314 0:432b860b6ff7 59 //during the real-time action, we will never pass the followong if test ( no characters received)
jekain314 0:432b860b6ff7 60 if (toPC.readable()) //read a PC serial byte and test it for a command
jekain314 0:432b860b6ff7 61 {
jekain314 0:432b860b6ff7 62
jekain314 0:432b860b6ff7 63 // Read in next character
jekain314 1:8e24e633f8d8 64 unsigned char inChar = 0;
jekain314 1:8e24e633f8d8 65 if(toPC.readable() ) inChar = toPC.getc(); //read char from the USB serial link to the PC
jekain314 0:432b860b6ff7 66 //toPC.printf("%02x ",inChar);
jekain314 0:432b860b6ff7 67
jekain314 0:432b860b6ff7 68 //incoming messages will end witb a CR / LF -- disregard these chars
jekain314 0:432b860b6ff7 69 if (inChar == CR || inChar == LF) return; //CR is a 0x0a
jekain314 0:432b860b6ff7 70
jekain314 0:432b860b6ff7 71 serBuf[serBufChars++] = inChar; //set this char in a char array
jekain314 0:432b860b6ff7 72
jekain314 0:432b860b6ff7 73 //no need to continue if numChars are less than the shortest candidate message
jekain314 0:432b860b6ff7 74 //if (serBufChars < minMessageSize) return;
jekain314 0:432b860b6ff7 75
jekain314 0:432b860b6ff7 76 // Append end of string
jekain314 0:432b860b6ff7 77 //We always assume we have a complete message string and test for this below
jekain314 1:8e24e633f8d8 78 if (serBufChars >= serBuffMax) {toPC.printf(" overun char buff \n"); serBufChars = 0; return; };
jekain314 0:432b860b6ff7 79 serBuf[serBufChars] = '\0';
jekain314 0:432b860b6ff7 80
jekain314 0:432b860b6ff7 81 bool validMessage = false;
jekain314 0:432b860b6ff7 82
jekain314 0:432b860b6ff7 83
jekain314 0:432b860b6ff7 84 // Check for valid message -- there are numMessages possible messages
jekain314 0:432b860b6ff7 85 for (int m = 0; m < numMessages && !validMessage; m++) //check for all messages ...
jekain314 0:432b860b6ff7 86 {
jekain314 0:432b860b6ff7 87 //toPC.printf(" \n\n found chars to test %3d %3d %s \n\n\n ", serBufChars, strlen(msgList[m]), serBuf );
jekain314 0:432b860b6ff7 88
jekain314 0:432b860b6ff7 89 //check the current partial message against ALL possible messages
jekain314 0:432b860b6ff7 90 //messages must match in both strength length and text
jekain314 0:432b860b6ff7 91 if (serBufChars == strlen(msgList[m]) && strncmp(serBuf, msgList[m], serBufChars) == 0 )
jekain314 0:432b860b6ff7 92 {
jekain314 0:432b860b6ff7 93
jekain314 0:432b860b6ff7 94 //toPC.printf( "\n found valid message %s \n\n", serBuf);
jekain314 1:8e24e633f8d8 95 rxMsg = !rxMsg;
jekain314 0:432b860b6ff7 96
jekain314 0:432b860b6ff7 97 validMessage = true;
jekain314 0:432b860b6ff7 98 serBufChars = 0; //reset the character count to reset for next message
jekain314 0:432b860b6ff7 99
jekain314 0:432b860b6ff7 100 //set programmatic action flags based on the message
jekain314 0:432b860b6ff7 101 switch(m)
jekain314 0:432b860b6ff7 102 {
jekain314 0:432b860b6ff7 103 case STATUS_MSG:
jekain314 0:432b860b6ff7 104 sendStatus = true; //send a status message back to PC
jekain314 0:432b860b6ff7 105 break;
jekain314 0:432b860b6ff7 106 case POSVEL_MSG:
jekain314 0:432b860b6ff7 107 sendPosVel = true; //send a posvel message back to PC
jekain314 0:432b860b6ff7 108 break;
jekain314 0:432b860b6ff7 109 case STARTDATA_MSG: //start the data recording to the SD card
jekain314 0:432b860b6ff7 110 recordData = true;
jekain314 0:432b860b6ff7 111 sendRecData = true;
jekain314 0:432b860b6ff7 112 break;
jekain314 0:432b860b6ff7 113 case STOPDATA_MSG: //stop the data recording to the SD card
jekain314 0:432b860b6ff7 114 recordData = false;
jekain314 0:432b860b6ff7 115 sendRecData = true;
jekain314 0:432b860b6ff7 116 break;
jekain314 0:432b860b6ff7 117 case STARTSTREAM_MSG:
jekain314 0:432b860b6ff7 118 case STOPSTREAM_MSG:
jekain314 0:432b860b6ff7 119 streamPos = (m == STARTSTREAM_MSG);
jekain314 0:432b860b6ff7 120 sendStreamPos = true;
jekain314 0:432b860b6ff7 121 break;
jekain314 0:432b860b6ff7 122 case STARTLOGINFO_MSG:
jekain314 0:432b860b6ff7 123 case STOPLOGINFO_MSG:
jekain314 0:432b860b6ff7 124 logMsgInfo = (m == STARTLOGINFO_MSG);
jekain314 0:432b860b6ff7 125 sendLogMsgInfo = true;
jekain314 0:432b860b6ff7 126 break;
jekain314 1:8e24e633f8d8 127 case FIRE_TRIGGER_MSG:
jekain314 1:8e24e633f8d8 128 fireTrigger = true;
jekain314 1:8e24e633f8d8 129 break;
jekain314 0:432b860b6ff7 130 } //end Switch statement
jekain314 0:432b860b6ff7 131 break;
jekain314 0:432b860b6ff7 132 } //end test for a valid message
jekain314 0:432b860b6ff7 133 } //end message text loop
jekain314 0:432b860b6ff7 134 } //end pc.readable
jekain314 0:432b860b6ff7 135 };
jekain314 0:432b860b6ff7 136
jekain314 0:432b860b6ff7 137 void earthCoefficients(double latitudeRad, double longitudeRad, double height, double &latRateFac, double &lonRateFac)
jekain314 0:432b860b6ff7 138 {
jekain314 0:432b860b6ff7 139 //compute the lat and lon factors for use in the interpolation of the lat and lon between 1 sec epochs
jekain314 0:432b860b6ff7 140 //latRateFac & lonRateFac multiplied by Vnorth or VEast to get latRate and lonRate
jekain314 0:432b860b6ff7 141 //see this document (page 32) www.fas.org/spp/military/program/nav/basicnav.pdf
jekain314 0:432b860b6ff7 142
jekain314 0:432b860b6ff7 143 double eccenSinLat = eccen * sin(latitudeRad);
jekain314 0:432b860b6ff7 144 double temp1 = 1.0 - eccenSinLat*eccenSinLat;
jekain314 0:432b860b6ff7 145 double temp2 = sqrt(temp1);
jekain314 0:432b860b6ff7 146 double r_meridian = earthRadius * ( 1.0 - eccen*eccen)/ (temp1 * temp2);
jekain314 0:432b860b6ff7 147 double r_normal = earthRadius / temp2;
jekain314 0:432b860b6ff7 148
jekain314 0:432b860b6ff7 149 //divide Vnorth by latRateFac to get the latitude rate in deg per sec
jekain314 0:432b860b6ff7 150 latRateFac = (r_meridian + height)* DEGREES_TO_RADIANS;
jekain314 0:432b860b6ff7 151
jekain314 0:432b860b6ff7 152 //divide VEast by lonRateFac to get the longitude rate in deg per sec
jekain314 0:432b860b6ff7 153 lonRateFac = (r_normal + height) * cos(latitudeRad)* DEGREES_TO_RADIANS;
jekain314 0:432b860b6ff7 154 }
jekain314 0:432b860b6ff7 155
jekain314 0:432b860b6ff7 156 void sendPosVelMessageToPC(OEM615BESTPOS posMsg, OEM615BESTVEL velMsg)
jekain314 0:432b860b6ff7 157 {
jekain314 0:432b860b6ff7 158 //north and east velocity from the horizontal speed and heading
jekain314 0:432b860b6ff7 159 //velMsg may not be the "current" message --- but is the one also associated with a position message
jekain314 0:432b860b6ff7 160 double nVel = velMsg.horizontalSpeed*cos(velMsg.heading*DEGREES_TO_RADIANS);
jekain314 0:432b860b6ff7 161 double eVel = velMsg.horizontalSpeed*sin(velMsg.heading*DEGREES_TO_RADIANS);
jekain314 0:432b860b6ff7 162
jekain314 0:432b860b6ff7 163 double latRateFac;
jekain314 0:432b860b6ff7 164 double lonRateFac;
jekain314 0:432b860b6ff7 165
jekain314 0:432b860b6ff7 166 earthCoefficients( posMsg.latitude*DEGREES_TO_RADIANS,
jekain314 0:432b860b6ff7 167 posMsg.longitude*DEGREES_TO_RADIANS,
jekain314 0:432b860b6ff7 168 posMsg.height,
jekain314 0:432b860b6ff7 169 latRateFac, lonRateFac);
jekain314 0:432b860b6ff7 170
jekain314 0:432b860b6ff7 171 //commented calculations are for a spherical earth (Chris's original computation)
jekain314 0:432b860b6ff7 172 // For the 1 second deltas with which we are dealing
jekain314 0:432b860b6ff7 173 // This calculation should be close enough for now
jekain314 0:432b860b6ff7 174 // Approximately 1 nautical mile / minute latitude, 60 minutes/degree, 1852 meters/nautical mile
jekain314 0:432b860b6ff7 175 //double latMetersPerDeg = 60.0*1852.0;
jekain314 0:432b860b6ff7 176 // longitude separation is approximately equal to latitude separation * cosine of latitude
jekain314 0:432b860b6ff7 177 //double lonMetersPerDeg = latMetersPerDeg*cos(posMsg.latitude*DEGREES_TO_RADIANS);
jekain314 0:432b860b6ff7 178
jekain314 0:432b860b6ff7 179 // Elapsed time since last known GPS position
jekain314 0:432b860b6ff7 180 //PPSTimeOffset is a result of possibly missing a prior GPS position message
jekain314 0:432b860b6ff7 181 // timeFromPPS.read() is always the time from the moset recent 1PPS
jekain314 0:432b860b6ff7 182 double elTime = (double)PPSTimeOffset + timeFromPPS.read();
jekain314 0:432b860b6ff7 183
jekain314 0:432b860b6ff7 184 // Position time -- GPSTime is the time of the last valid GPS position message
jekain314 1:8e24e633f8d8 185 double posTime = GPSTimemsecs/1000 + elTime;
jekain314 0:432b860b6ff7 186
jekain314 0:432b860b6ff7 187 //toPC.printf(" elTime = %6.3f PPSimeOffset = %6.3f \n", elTime, PPSTimeOffset);
jekain314 0:432b860b6ff7 188 //toPC.printf(" latRateFac = %10.3f lonRateFac = %10.3f \n", latRateFac, lonRateFac);
jekain314 0:432b860b6ff7 189 //toPC.printf(" latRateFac = %10.3f lonRateFac = %10.3f \n", latMetersPerDeg, lonMetersPerDeg);
jekain314 0:432b860b6ff7 190
jekain314 0:432b860b6ff7 191 // Estimated position based on previous position and velocity
jekain314 0:432b860b6ff7 192 // posMsg is the last time when the BESTVEL and BESTPOS messages had identical times
jekain314 0:432b860b6ff7 193 //double latPos = posMsg.latitude + (nVel/latMetersPerDeg)*elTime;
jekain314 0:432b860b6ff7 194 //double lonPos = posMsg.longitude + (eVel/lonMetersPerDeg)*elTime;
jekain314 0:432b860b6ff7 195
jekain314 0:432b860b6ff7 196 double latPos = posMsg.latitude + (nVel/latRateFac)*elTime;
jekain314 0:432b860b6ff7 197 double lonPos = posMsg.longitude + (eVel/lonRateFac)*elTime;
jekain314 0:432b860b6ff7 198 double htPos = posMsg.height + velMsg.verticalSpeed/(60*1852)*elTime;
jekain314 0:432b860b6ff7 199
jekain314 0:432b860b6ff7 200 char solReady = 'N';
jekain314 0:432b860b6ff7 201 //solStatus
jekain314 0:432b860b6ff7 202 if (posMsg.solStatus == 0) //see description of solution status in OEMV615.h
jekain314 0:432b860b6ff7 203 {
jekain314 0:432b860b6ff7 204 solReady = 'Y';
jekain314 0:432b860b6ff7 205 }
jekain314 0:432b860b6ff7 206
jekain314 0:432b860b6ff7 207 toPC.printf("WMsg POSVEL %5.3lf %1d %c %8.5lf %9.5lf %4.3lf %4.3lf %4.3lf %4.3lf\n",
jekain314 0:432b860b6ff7 208 posTime,
jekain314 0:432b860b6ff7 209 posMsg.numSolSV,
jekain314 0:432b860b6ff7 210 solReady,
jekain314 0:432b860b6ff7 211 latPos,
jekain314 0:432b860b6ff7 212 lonPos,
jekain314 0:432b860b6ff7 213 htPos,
jekain314 0:432b860b6ff7 214 nVel,
jekain314 0:432b860b6ff7 215 eVel,
jekain314 0:432b860b6ff7 216 velMsg.verticalSpeed
jekain314 0:432b860b6ff7 217 );
jekain314 1:8e24e633f8d8 218 txMsg = !txMsg;
jekain314 0:432b860b6ff7 219 }
jekain314 0:432b860b6ff7 220
jekain314 0:432b860b6ff7 221 void processPCmessages(FILE* &fpNav, OEM615BESTPOS posMsg, OEM615BESTVEL velMsg)
jekain314 0:432b860b6ff7 222 {
jekain314 0:432b860b6ff7 223
jekain314 1:8e24e633f8d8 224
jekain314 1:8e24e633f8d8 225
jekain314 0:432b860b6ff7 226 //we should put the below stuff into the readPC() procedure.
jekain314 0:432b860b6ff7 227 //only do these actions in response to a command so no need for the tests w/o an inoput byte from the PC
jekain314 0:432b860b6ff7 228 //perform the activities as a response to the commands
jekain314 0:432b860b6ff7 229 if (sendPosVel) //true if we want to return a position solution
jekain314 0:432b860b6ff7 230 {
jekain314 0:432b860b6ff7 231 sendPosVel=false; //set to true if a POSVEL is requested from the PC
jekain314 0:432b860b6ff7 232 sendPosVelMessageToPC(posMsg, velMsg);
jekain314 0:432b860b6ff7 233 }
jekain314 0:432b860b6ff7 234
jekain314 0:432b860b6ff7 235 //all this does is assess the GPS convergence -- really available in the above
jekain314 0:432b860b6ff7 236 if (sendStatus) //send the status message to the PC
jekain314 0:432b860b6ff7 237 {
jekain314 1:8e24e633f8d8 238 txMsg = !txMsg;
jekain314 0:432b860b6ff7 239 sendStatus=false;
jekain314 0:432b860b6ff7 240 char solReady = 'N';
jekain314 0:432b860b6ff7 241 //solStatus
jekain314 0:432b860b6ff7 242 if (posMsg.solStatus == 0) //see description of solution status in OEMV615.h
jekain314 0:432b860b6ff7 243 {
jekain314 0:432b860b6ff7 244 solReady = 'Y';
jekain314 0:432b860b6ff7 245 }
jekain314 0:432b860b6ff7 246 toPC.printf("WMsg STATUS %5.3lf %c\n",
jekain314 1:8e24e633f8d8 247 GPSTimemsecs,
jekain314 0:432b860b6ff7 248 solReady
jekain314 0:432b860b6ff7 249 );
jekain314 0:432b860b6ff7 250 }
jekain314 0:432b860b6ff7 251
jekain314 0:432b860b6ff7 252 //should just record ALL the data -- can pick over it in the post-processing
jekain314 0:432b860b6ff7 253 if (sendRecData) //begin to (or stop) record the serial data
jekain314 0:432b860b6ff7 254 {
jekain314 1:8e24e633f8d8 255 sendRecData=false; //reset the flag so we dont continue to come through here
jekain314 0:432b860b6ff7 256 char recChar = 'N';
jekain314 1:8e24e633f8d8 257 //recordData set to true only if we receive a STARTDATA from the PC
jekain314 1:8e24e633f8d8 258 if (recordData) //here we have received a message to record the data
jekain314 0:432b860b6ff7 259 {
jekain314 1:8e24e633f8d8 260 if ((fpNav == NULL)) //if file not opened -- open it
jekain314 0:432b860b6ff7 261 {
jekain314 1:8e24e633f8d8 262 toPC.printf(" opening the SD card file \n");
jekain314 0:432b860b6ff7 263 fpNav = fopen("/sd/Data/NAV.bin", "wb");
jekain314 1:8e24e633f8d8 264 wait_ms(1000);
jekain314 0:432b860b6ff7 265 }
jekain314 1:8e24e633f8d8 266 if (fpNav != NULL) //if the fie was already opened we will respond to the PC with a Y
jekain314 0:432b860b6ff7 267 {
jekain314 0:432b860b6ff7 268 recChar = 'Y';
jekain314 0:432b860b6ff7 269 }
jekain314 1:8e24e633f8d8 270 else //is the file was not opened we will write a message to the PC
jekain314 0:432b860b6ff7 271 {
jekain314 0:432b860b6ff7 272 toPC.printf(" Could not open the SD card \n\n");
jekain314 0:432b860b6ff7 273 }
jekain314 0:432b860b6ff7 274 }
jekain314 1:8e24e633f8d8 275 //recordData set to false only if we receive a STOPDATA from the PC
jekain314 1:8e24e633f8d8 276 else //here we have received a message to stop the recording
jekain314 0:432b860b6ff7 277 {
jekain314 1:8e24e633f8d8 278 if (fpNav != NULL) //if the file is open -- close it
jekain314 0:432b860b6ff7 279 {
jekain314 0:432b860b6ff7 280 toPC.printf(" closing the SD card file \n\n");
jekain314 1:8e24e633f8d8 281 fflush(fpNav);
jekain314 0:432b860b6ff7 282 fclose(fpNav);
jekain314 1:8e24e633f8d8 283 wait_ms(1000);
jekain314 0:432b860b6ff7 284 //toPC.printf("\n after closing the SD card file \n\n");
jekain314 0:432b860b6ff7 285 fpNav = NULL;
jekain314 0:432b860b6ff7 286 }
jekain314 1:8e24e633f8d8 287 //if stop recording received and the file is already closed -- just do nothing
jekain314 1:8e24e633f8d8 288 recordData = false;
jekain314 1:8e24e633f8d8 289
jekain314 0:432b860b6ff7 290 }
jekain314 0:432b860b6ff7 291 toPC.printf("WMsg RECORDDATA %c\n",
jekain314 0:432b860b6ff7 292 recChar
jekain314 0:432b860b6ff7 293 );
jekain314 0:432b860b6ff7 294 }
jekain314 0:432b860b6ff7 295
jekain314 0:432b860b6ff7 296 if (sendStreamPos) //stream the position data to the PC
jekain314 0:432b860b6ff7 297 {
jekain314 0:432b860b6ff7 298 sendStreamPos=false;
jekain314 0:432b860b6ff7 299 char streamChar = 'N';
jekain314 0:432b860b6ff7 300 if (streamPos)
jekain314 0:432b860b6ff7 301 {
jekain314 0:432b860b6ff7 302 streamChar = 'Y';
jekain314 0:432b860b6ff7 303 }
jekain314 0:432b860b6ff7 304 toPC.printf("WMsg POSSTREAM %c\n",
jekain314 0:432b860b6ff7 305 streamChar
jekain314 0:432b860b6ff7 306 );
jekain314 0:432b860b6ff7 307 }
jekain314 0:432b860b6ff7 308
jekain314 0:432b860b6ff7 309 //not sure this is ever used ..
jekain314 0:432b860b6ff7 310 if (sendLogMsgInfo) //send log info to the PC
jekain314 0:432b860b6ff7 311 {
jekain314 0:432b860b6ff7 312 sendLogMsgInfo=false;
jekain314 0:432b860b6ff7 313 char logChar = 'N';
jekain314 0:432b860b6ff7 314 if (logMsgInfo)
jekain314 0:432b860b6ff7 315 {
jekain314 0:432b860b6ff7 316 logChar = 'Y';
jekain314 0:432b860b6ff7 317 }
jekain314 0:432b860b6ff7 318 toPC.printf("WMsg LOGINFO %c\n",
jekain314 0:432b860b6ff7 319 logChar
jekain314 0:432b860b6ff7 320 );
jekain314 0:432b860b6ff7 321 }
jekain314 0:432b860b6ff7 322
jekain314 0:432b860b6ff7 323
jekain314 0:432b860b6ff7 324 }