clang
This commit is contained in:
parent
8ae6a7b75a
commit
1afe1df764
|
|
@ -34,7 +34,7 @@
|
||||||
#define NMEA_EXTENSIONS ///< if defined will include more NMEA sentences
|
#define NMEA_EXTENSIONS ///< if defined will include more NMEA sentences
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if(NMEA_EXTRAS > 0)
|
#if (NMEA_EXTRAS > 0)
|
||||||
#define NMEA_EXTENSIONS ///< if defined will include more NMEA sentences
|
#define NMEA_EXTENSIONS ///< if defined will include more NMEA sentences
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -247,8 +247,8 @@ private:
|
||||||
bool isEmpty(char *pStart);
|
bool isEmpty(char *pStart);
|
||||||
|
|
||||||
// used by check() for validity tests, room for future expansion
|
// used by check() for validity tests, room for future expansion
|
||||||
const char *sources[6] = {"II", "WI", "GP",
|
const char *sources[6] = {"II", "WI", "GP",
|
||||||
"GN", "P", "ZZZ"}; ///< valid source ids
|
"GN", "P", "ZZZ"}; ///< valid source ids
|
||||||
#ifdef NMEA_EXTENSIONS
|
#ifdef NMEA_EXTENSIONS
|
||||||
const char
|
const char
|
||||||
*sentences_parsed[20] =
|
*sentences_parsed[20] =
|
||||||
|
|
@ -260,9 +260,8 @@ private:
|
||||||
"APB", "DPT", "GSV", "HDG", "MWD", "ROT",
|
"APB", "DPT", "GSV", "HDG", "MWD", "ROT",
|
||||||
"RPM", "RSA", "VDR", "VTG", "ZDA", "ZZZ"}; ///< known, but not parseable
|
"RPM", "RSA", "VDR", "VTG", "ZDA", "ZZZ"}; ///< known, but not parseable
|
||||||
#else // make the lists short to save memory
|
#else // make the lists short to save memory
|
||||||
const char
|
const char *sentences_parsed[5] = {"GGA", "GLL", "GSA", "RMC",
|
||||||
*sentences_parsed[5] = {"GGA", "GLL", "GSA", "RMC",
|
"ZZZ"}; ///< parseable sentence ids
|
||||||
"ZZZ"}; ///< parseable sentence ids
|
|
||||||
const char *sentences_known[4] = {"DBT", "HDM", "HDT",
|
const char *sentences_known[4] = {"DBT", "HDM", "HDT",
|
||||||
"ZZZ"}; ///< known, but not parseable
|
"ZZZ"}; ///< known, but not parseable
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ void Adafruit_GPS::newDataValue(nmea_index_t idx, nmea_float_t v) {
|
||||||
newDataValue((nmea_index_t)(idx + 2), cos(v / RAD_TO_DEG));
|
newDataValue((nmea_index_t)(idx + 2), cos(v / RAD_TO_DEG));
|
||||||
}
|
}
|
||||||
// weighting factor for smoothing depends on delta t / tau
|
// weighting factor for smoothing depends on delta t / tau
|
||||||
nmea_float_t w =
|
nmea_float_t w =
|
||||||
min((nmea_float_t)1.0,
|
min((nmea_float_t)1.0,
|
||||||
((nmea_float_t)millis() - val[idx].lastUpdate) / val[idx].response);
|
((nmea_float_t)millis() - val[idx].lastUpdate) / val[idx].response);
|
||||||
// default smoothing
|
// default smoothing
|
||||||
|
|
@ -438,7 +438,7 @@ void Adafruit_GPS::removeHistory(nmea_index_t idx) {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_GPS::showDataValue(nmea_index_t idx, int n) {
|
void Adafruit_GPS::showDataValue(nmea_index_t idx, int n) {
|
||||||
Serial.print("idx: ");
|
Serial.print("idx: ");
|
||||||
if(idx < 10)
|
if (idx < 10)
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
Serial.print(idx);
|
Serial.print(idx);
|
||||||
Serial.print(", ");
|
Serial.print(", ");
|
||||||
|
|
@ -461,8 +461,8 @@ void Adafruit_GPS::showDataValue(nmea_index_t idx, int n) {
|
||||||
Serial.print(" second intervals: ");
|
Serial.print(" second intervals: ");
|
||||||
Serial.print(val[idx].hist->data[val[idx].hist->n - 1]);
|
Serial.print(val[idx].hist->data[val[idx].hist->n - 1]);
|
||||||
for (unsigned i = val[idx].hist->n - 2;
|
for (unsigned i = val[idx].hist->n - 2;
|
||||||
i >= max(val[idx].hist->n - n, (unsigned)0);
|
i >= max(val[idx].hist->n - n, (unsigned)0);
|
||||||
i--) { // most recent first
|
i--) { // most recent first
|
||||||
Serial.print(", ");
|
Serial.print(", ");
|
||||||
Serial.print(val[idx].hist->data[i]);
|
Serial.print(val[idx].hist->data[i]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -700,9 +700,9 @@ bool Adafruit_GPS::parseCoord(char *pStart, nmea_float_t *angleDegrees,
|
||||||
|
|
||||||
// reject angles that are out of range
|
// reject angles that are out of range
|
||||||
if (nsew == 'N' || nsew == 'S')
|
if (nsew == 'N' || nsew == 'S')
|
||||||
if(abs(deg) > 90)
|
if (abs(deg) > 90)
|
||||||
return false;
|
return false;
|
||||||
if(abs(deg) > 180)
|
if (abs(deg) > 180)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// store in locations passed as args
|
// store in locations passed as args
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue