Fix formatting
This commit is contained in:
parent
e3caa7d491
commit
a0cf6d860a
|
|
@ -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 Adafruit_GPS::boatAngle(nmea_float_t s, nmea_float_t c) {
|
||||||
nmea_float_t sAng =
|
// put the sin angle in -90 to 90 range
|
||||||
asin(s) * (nmea_float_t)RAD_TO_DEG; // put the sin angle in -90 to 90 range
|
nmea_float_t sAng = asin(s) * (nmea_float_t)RAD_TO_DEG;
|
||||||
while (sAng < -90)
|
while (sAng < -90)
|
||||||
sAng += 180.0f;
|
sAng += 180.0f;
|
||||||
while (sAng > 90)
|
while (sAng > 90)
|
||||||
sAng -= 180.0f;
|
sAng -= 180.0f;
|
||||||
nmea_float_t cAng =
|
// put the cos angle in 0 to 180 range
|
||||||
acos(c) * (nmea_float_t)RAD_TO_DEG; // put the cos angle in 0 to 180 range
|
nmea_float_t cAng = acos(c) * (nmea_float_t)RAD_TO_DEG;
|
||||||
while (cAng < 0)
|
while (cAng < 0)
|
||||||
cAng += 180.0f;
|
cAng += 180.0f;
|
||||||
while (cAng > 180)
|
while (cAng > 180)
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,8 @@ bool Adafruit_GPS::parse(char *nmea) {
|
||||||
// feet, metres, fathoms below transducer coerced to water depth from
|
// feet, metres, fathoms below transducer coerced to water depth from
|
||||||
// surface in metres
|
// surface in metres
|
||||||
if (!isEmpty(p))
|
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;
|
||||||
p = strchr(p, ',') + 1;
|
p = strchr(p, ',') + 1;
|
||||||
if (!isEmpty(p))
|
if (!isEmpty(p))
|
||||||
|
|
@ -192,7 +193,8 @@ bool Adafruit_GPS::parse(char *nmea) {
|
||||||
p = strchr(p, ',') + 1;
|
p = strchr(p, ',') + 1;
|
||||||
p = strchr(p, ',') + 1;
|
p = strchr(p, ',') + 1;
|
||||||
if (!isEmpty(p))
|
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
|
} else if (!strcmp(thisSentence, "DPT")) { //*****************************DPT
|
||||||
// from Actisense NGW-1
|
// from Actisense NGW-1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue