clang hates trailing white space
This commit is contained in:
parent
0051f37600
commit
c006654469
|
|
@ -323,7 +323,9 @@ boolean Adafruit_GPS::parseFix(char *p) {
|
||||||
@return nmea_float_t value in seconds since last fix.
|
@return nmea_float_t value in seconds since last fix.
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
nmea_float_t Adafruit_GPS::secondsSinceFix() { return (millis() - lastFix) / 1000.; }
|
nmea_float_t Adafruit_GPS::secondsSinceFix() {
|
||||||
|
return (millis() - lastFix) / 1000.;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -332,7 +334,9 @@ nmea_float_t Adafruit_GPS::secondsSinceFix() { return (millis() - lastFix) / 100
|
||||||
@return nmea_float_t value in seconds since last GPS time.
|
@return nmea_float_t value in seconds since last GPS time.
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
nmea_float_t Adafruit_GPS::secondsSinceTime() { return (millis() - lastTime) / 1000.; }
|
nmea_float_t Adafruit_GPS::secondsSinceTime() {
|
||||||
|
return (millis() - lastTime) / 1000.;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -341,7 +345,9 @@ nmea_float_t Adafruit_GPS::secondsSinceTime() { return (millis() - lastTime) / 1
|
||||||
@return nmea_float_t value in seconds since last GPS date.
|
@return nmea_float_t value in seconds since last GPS date.
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
nmea_float_t Adafruit_GPS::secondsSinceDate() { return (millis() - lastDate) / 1000.; }
|
nmea_float_t Adafruit_GPS::secondsSinceDate() {
|
||||||
|
return (millis() - lastDate) / 1000.;
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -53,10 +53,10 @@
|
||||||
#if (defined(__AVR__) || defined(ESP8266)) && defined(USE_SW_SERIAL)
|
#if (defined(__AVR__) || defined(ESP8266)) && defined(USE_SW_SERIAL)
|
||||||
#include <SoftwareSerial.h>
|
#include <SoftwareSerial.h>
|
||||||
#endif
|
#endif
|
||||||
#include <SPI.h>
|
|
||||||
#include <Wire.h>
|
|
||||||
#include <NMEA_data.h>
|
#include <NMEA_data.h>
|
||||||
#include <Adafruit_PMTK.h>
|
#include <Adafruit_PMTK.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <Wire.h>
|
||||||
|
|
||||||
/// type for resulting code from running check()
|
/// type for resulting code from running check()
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
@ -105,7 +105,7 @@ public:
|
||||||
nmea_float_t secondsSinceTime();
|
nmea_float_t secondsSinceTime();
|
||||||
nmea_float_t secondsSinceDate();
|
nmea_float_t secondsSinceDate();
|
||||||
void resetSentTime();
|
void resetSentTime();
|
||||||
|
|
||||||
boolean wakeup(void);
|
boolean wakeup(void);
|
||||||
boolean standby(void);
|
boolean standby(void);
|
||||||
|
|
||||||
|
|
@ -129,10 +129,10 @@ public:
|
||||||
uint8_t month; ///< GMT month
|
uint8_t month; ///< GMT month
|
||||||
uint8_t day; ///< GMT day
|
uint8_t day; ///< GMT day
|
||||||
|
|
||||||
nmea_float_t latitude; ///< Floating point latitude value in degrees/minutes as
|
nmea_float_t latitude; ///< Floating point latitude value in degrees/minutes
|
||||||
///< received from the GPS (DDMM.MMMM)
|
///< as received from the GPS (DDMM.MMMM)
|
||||||
nmea_float_t longitude; ///< Floating point longitude value in degrees/minutes as
|
nmea_float_t longitude; ///< Floating point longitude value in degrees/minutes
|
||||||
///< received from the GPS (DDDMM.MMMM)
|
///< as received from the GPS (DDDMM.MMMM)
|
||||||
|
|
||||||
/** Fixed point latitude and longitude value with degrees stored in units of
|
/** Fixed point latitude and longitude value with degrees stored in units of
|
||||||
1/100000 degrees, and minutes stored in units of 1/100000 degrees. See pull
|
1/100000 degrees, and minutes stored in units of 1/100000 degrees. See pull
|
||||||
|
|
@ -147,17 +147,17 @@ public:
|
||||||
nmea_float_t altitude; ///< Altitude in meters above MSL
|
nmea_float_t altitude; ///< Altitude in meters above MSL
|
||||||
nmea_float_t speed; ///< Current speed over ground in knots
|
nmea_float_t speed; ///< Current speed over ground in knots
|
||||||
nmea_float_t angle; ///< Course in degrees from true north
|
nmea_float_t angle; ///< Course in degrees from true north
|
||||||
nmea_float_t magvariation; ///< Magnetic variation in degrees (vs. true north)
|
nmea_float_t magvariation; ///< Magnetic variation in degrees (vs. true north)
|
||||||
nmea_float_t HDOP; ///< Horizontal Dilution of Precision - relative accuracy of
|
nmea_float_t HDOP; ///< Horizontal Dilution of Precision - relative accuracy
|
||||||
///< horizontal position
|
///< of horizontal position
|
||||||
nmea_float_t VDOP; ///< Vertical Dilution of Precision - relative accuracy of
|
nmea_float_t VDOP; ///< Vertical Dilution of Precision - relative accuracy
|
||||||
///< vertical position
|
///< of vertical position
|
||||||
nmea_float_t PDOP; ///< Position Dilution of Precision - Complex maths derives a
|
nmea_float_t PDOP; ///< Position Dilution of Precision - Complex maths derives
|
||||||
///< simple, single number for each kind of DOP
|
///< a simple, single number for each kind of DOP
|
||||||
char lat = 'X'; ///< N/S
|
char lat = 'X'; ///< N/S
|
||||||
char lon = 'X'; ///< E/W
|
char lon = 'X'; ///< E/W
|
||||||
char mag = 'X'; ///< Magnetic variation direction
|
char mag = 'X'; ///< Magnetic variation direction
|
||||||
boolean fix; ///< Have a fix?
|
boolean fix; ///< Have a fix?
|
||||||
uint8_t fixquality; ///< Fix quality (0, 1, 2 = Invalid, GPS, DGPS)
|
uint8_t fixquality; ///< Fix quality (0, 1, 2 = Invalid, GPS, DGPS)
|
||||||
uint8_t fixquality_3d; ///< 3D fix quality (1, 3, 3 = Nofix, 2D fix, 3D fix)
|
uint8_t fixquality_3d; ///< 3D fix quality (1, 3, 3 = Nofix, 2D fix, 3D fix)
|
||||||
uint8_t satellites; ///< Number of satellites in use
|
uint8_t satellites; ///< Number of satellites in use
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#define NMEA_MAX_SOURCE_ID \
|
#define NMEA_MAX_SOURCE_ID \
|
||||||
3 ///< maximum length of a source ID name, including terminating 0
|
3 ///< maximum length of a source ID name, including terminating 0
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
doubles and floats are identical on AVR processors like the UNO where space
|
doubles and floats are identical on AVR processors like the UNO where space
|
||||||
is tight. doubles avoid the roundoff errors that led to the fixed point mods
|
is tight. doubles avoid the roundoff errors that led to the fixed point mods
|
||||||
in https://github.com/adafruit/Adafruit-GPS-Library/pull/13, provided the
|
in https://github.com/adafruit/Adafruit-GPS-Library/pull/13, provided the
|
||||||
|
|
@ -40,18 +40,18 @@ typedef double
|
||||||
can be converted back to an approximate float value with
|
can be converted back to an approximate float value with
|
||||||
X = I / scale + offset
|
X = I / scale + offset
|
||||||
|
|
||||||
Only some tags have history in order to save memory. Most of the memory
|
Only some tags have history in order to save memory. Most of the memory
|
||||||
cost is directly in the array.
|
cost is directly in the array.
|
||||||
|
|
||||||
192 history values taken every 20 seconds covers just over an hour.
|
192 history values taken every 20 seconds covers just over an hour.
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int16_t *data = NULL; ///< array of ints, oldest first
|
int16_t *data = NULL; ///< array of ints, oldest first
|
||||||
unsigned n = 0; ///< number of history array elements
|
unsigned n = 0; ///< number of history array elements
|
||||||
uint32_t lastHistory = 0; ///< millis() when history was last updated
|
uint32_t lastHistory = 0; ///< millis() when history was last updated
|
||||||
uint16_t historyInterval = 20; ///< seconds between history updates
|
uint16_t historyInterval = 20; ///< seconds between history updates
|
||||||
nmea_float_t scale = 1.0; ///< history = (smoothed - offset) * scale
|
nmea_float_t scale = 1.0; ///< history = (smoothed - offset) * scale
|
||||||
nmea_float_t offset = 0.0; ///< value = (float) history / scale + offset
|
nmea_float_t offset = 0.0; ///< value = (float) history / scale + offset
|
||||||
} nmea_history_t;
|
} nmea_history_t;
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
@ -85,7 +85,7 @@ typedef enum {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
Struct to contain all the details associated with an NMEA data value that
|
Struct to contain all the details associated with an NMEA data value that
|
||||||
can be tracked through time to see how it changes, carries a label, units,
|
can be tracked through time to see how it changes, carries a label, units,
|
||||||
and a format string to determine how it is displayed. Memory footprint
|
and a format string to determine how it is displayed. Memory footprint
|
||||||
of about 32 bytes per data value, so not tenable in small memory spaces.
|
of about 32 bytes per data value, so not tenable in small memory spaces.
|
||||||
*/
|
*/
|
||||||
|
|
@ -93,18 +93,16 @@ typedef enum {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
nmea_float_t latest = 0.0; ///< the most recently obtained value
|
nmea_float_t latest = 0.0; ///< the most recently obtained value
|
||||||
nmea_float_t smoothed =
|
nmea_float_t smoothed =
|
||||||
0.0; ///< smoothed value based on weight of dt/response
|
0.0; ///< smoothed value based on weight of dt/response
|
||||||
uint32_t lastUpdate = 0; ///< millis() when latest was last set
|
uint32_t lastUpdate = 0; ///< millis() when latest was last set
|
||||||
uint16_t response =
|
uint16_t response = 1000; ///< time constant in millis for smoothing
|
||||||
1000; ///< time constant in millis for smoothing
|
|
||||||
nmea_value_type_t type =
|
nmea_value_type_t type =
|
||||||
NMEA_SIMPLE_FLOAT; ///< type of float data value represented
|
NMEA_SIMPLE_FLOAT; ///< type of float data value represented
|
||||||
byte ockam =
|
byte ockam = 0; ///< the corresponding Ockam Instruments tag number, 0-128
|
||||||
0; ///< the corresponding Ockam Instruments tag number, 0-128
|
|
||||||
nmea_history_t *hist = NULL; ///< pointer to history, if any
|
nmea_history_t *hist = NULL; ///< pointer to history, if any
|
||||||
char *label = NULL; ///< pointer to quantity label, if any
|
char *label = NULL; ///< pointer to quantity label, if any
|
||||||
char *unit = NULL; ///< pointer to units label, if any
|
char *unit = NULL; ///< pointer to units label, if any
|
||||||
char *fmt = NULL; ///< pointer to format string, if any
|
char *fmt = NULL; ///< pointer to format string, if any
|
||||||
} nmea_datavalue_t;
|
} nmea_datavalue_t;
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
|
||||||
|
|
@ -228,5 +228,4 @@ boolean Adafruit_GPS::parse(char *nmea) {
|
||||||
strcpy(lastSentence, thisSentence);
|
strcpy(lastSentence, thisSentence);
|
||||||
lastUpdate = millis();
|
lastUpdate = millis();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Loading…
Reference in New Issue