diff --git a/src/NMEA_data.cpp b/src/NMEA_data.cpp index 0164f94..865f982 100644 --- a/src/NMEA_data.cpp +++ b/src/NMEA_data.cpp @@ -517,14 +517,14 @@ bool Adafruit_GPS::isCompoundAngle(nmea_index_t idx) { */ /**************************************************************************/ nmea_float_t Adafruit_GPS::boatAngle(nmea_float_t s, nmea_float_t c) { - nmea_float_t sAng = - asin(s) * (nmea_float_t)RAD_TO_DEG; // put the sin angle in -90 to 90 range + // put the sin angle in -90 to 90 range + nmea_float_t sAng = asin(s) * (nmea_float_t)RAD_TO_DEG; while (sAng < -90) sAng += 180.0f; while (sAng > 90) sAng -= 180.0f; - nmea_float_t cAng = - acos(c) * (nmea_float_t)RAD_TO_DEG; // put the cos angle in 0 to 180 range + // put the cos angle in 0 to 180 range + nmea_float_t cAng = acos(c) * (nmea_float_t)RAD_TO_DEG; while (cAng < 0) cAng += 180.0f; while (cAng > 180) diff --git a/src/NMEA_parse.cpp b/src/NMEA_parse.cpp index 22569f5..7e9e71e 100644 --- a/src/NMEA_parse.cpp +++ b/src/NMEA_parse.cpp @@ -184,7 +184,8 @@ bool Adafruit_GPS::parse(char *nmea) { // feet, metres, fathoms below transducer coerced to water depth from // surface in metres if (!isEmpty(p)) - newDataValue(NMEA_DEPTH, (nmea_float_t)atof(p) * 0.3048f + depthToTransducer); + newDataValue(NMEA_DEPTH, + (nmea_float_t)atof(p) * 0.3048f + depthToTransducer); p = strchr(p, ',') + 1; p = strchr(p, ',') + 1; if (!isEmpty(p)) @@ -192,7 +193,8 @@ bool Adafruit_GPS::parse(char *nmea) { p = strchr(p, ',') + 1; p = strchr(p, ',') + 1; if (!isEmpty(p)) - newDataValue(NMEA_DEPTH, (nmea_float_t)atof(p) * 6 * 0.3048f + depthToTransducer); + newDataValue(NMEA_DEPTH, + (nmea_float_t)atof(p) * 6 * 0.3048f + depthToTransducer); } else if (!strcmp(thisSentence, "DPT")) { //*****************************DPT // from Actisense NGW-1