diff --git a/Solutions/Inc/Nmea_Gga.h b/Solutions/Inc/Nmea_Gga.h index 2cde215..1428a82 100644 --- a/Solutions/Inc/Nmea_Gga.h +++ b/Solutions/Inc/Nmea_Gga.h @@ -13,6 +13,7 @@ #define DGPS_SID_MIN (0000) #define DGPS_SID_MAX (1023) +#define DIFF_GEOID_IS_BELOW '-' /** * GPS Quality indicator: */ diff --git a/Solutions/Src/Nmea_Gga.c b/Solutions/Src/Nmea_Gga.c index c7d7378..257a297 100644 --- a/Solutions/Src/Nmea_Gga.c +++ b/Solutions/Src/Nmea_Gga.c @@ -53,7 +53,9 @@ bool NmeaGga_Parse(char *str, size_t len, tNmeaGGA *result) *front : 0; result->diff = (Nmea0183ParseNextPortion(&front, &nextDivider, end) > 0) ? - Nmea0183ParseDouble(front,nextDivider - front) : 0; + (*front != DIFF_GEOID_IS_BELOW) ? + Nmea0183ParseDouble(front,nextDivider - front) : 0 + : 0; result->diff_units = (Nmea0183ParseNextPortion(&front, &nextDivider, end) > 0) ? *front : 0;