# HG changeset patch # User ethanzonca@CL-ENS241-08.cedarville.edu # Date 2013-04-18 21:31:01 # Node ID 2b32812e173701f2c1d5545a3c3f7b979d5920af # Parent 7033f0b40c6f749842a9cb3da4b07a878964a10c Fixed issue where GPS altitude included "M" after number diff --git a/master/master/lib/gps.c b/master/master/lib/gps.c --- a/master/master/lib/gps.c +++ b/master/master/lib/gps.c @@ -454,7 +454,15 @@ void parse_gps_transmission(void){ } else if(byte == ',') //end of this data type { - altitude[numBytes] = 0x00; + // If we actually have an altitude + if(numBytes>0) + { + altitude[numBytes-1] = 0x00; // Cut off the "M" from the end of the altitude + } + else + { + altitude[numBytes] = 0x00; + } setParserState(GGA_WGS84); numBytes = 0; //prep for next phase of parse }