Replace boolean with standard bool
This causes deprecation warnings when compiling with the STM32duino Arduino core.
This commit is contained in:
parent
5d28fd9672
commit
17bb6d1ed2
|
|
@ -27,7 +27,7 @@ Adafruit_GPS GPS(&mySerial);
|
||||||
// this keeps track of whether we're using the interrupt
|
// this keeps track of whether we're using the interrupt
|
||||||
// off by default!
|
// off by default!
|
||||||
#ifndef ESP8266 // Sadly not on ESP8266
|
#ifndef ESP8266 // Sadly not on ESP8266
|
||||||
boolean usingInterrupt = false;
|
bool usingInterrupt = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
@ -84,7 +84,7 @@ ISR(TIMER0_COMPA_vect) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void useInterrupt(boolean v) {
|
void useInterrupt(bool v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
||||||
// in the middle and call the "Compare A" function above
|
// in the middle and call the "Compare A" function above
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Adafruit_GPS GPS(&mySerial);
|
||||||
// this keeps track of whether we're using the interrupt
|
// this keeps track of whether we're using the interrupt
|
||||||
// off by default!
|
// off by default!
|
||||||
#ifndef ESP8266 // Sadly not on ESP8266
|
#ifndef ESP8266 // Sadly not on ESP8266
|
||||||
boolean usingInterrupt = false;
|
bool usingInterrupt = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
@ -89,7 +89,7 @@ ISR(TIMER0_COMPA_vect) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void useInterrupt(boolean v) {
|
void useInterrupt(bool v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
||||||
// in the middle and call the "Compare A" function above
|
// in the middle and call the "Compare A" function above
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Adafruit_GPS GPS(&mySerial);
|
||||||
// this keeps track of whether we're using the interrupt
|
// this keeps track of whether we're using the interrupt
|
||||||
// off by default!
|
// off by default!
|
||||||
#ifndef ESP8266 // Sadly not on ESP8266
|
#ifndef ESP8266 // Sadly not on ESP8266
|
||||||
boolean usingInterrupt = false;
|
bool usingInterrupt = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
|
|
@ -127,7 +127,7 @@ ISR(TIMER0_COMPA_vect) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void useInterrupt(boolean v) {
|
void useInterrupt(bool v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
||||||
// in the middle and call the "Compare A" function above
|
// in the middle and call the "Compare A" function above
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ Adafruit_GPS GPS(&mySerial);
|
||||||
// this keeps track of whether we're using the interrupt
|
// this keeps track of whether we're using the interrupt
|
||||||
// off by default!
|
// off by default!
|
||||||
#ifndef ESP8266 // Sadly not on ESP8266
|
#ifndef ESP8266 // Sadly not on ESP8266
|
||||||
boolean usingInterrupt = false;
|
bool usingInterrupt = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Set the pins used
|
// Set the pins used
|
||||||
|
|
@ -152,7 +152,7 @@ ISR(TIMER0_COMPA_vect) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void useInterrupt(boolean v) {
|
void useInterrupt(bool v) {
|
||||||
if (v) {
|
if (v) {
|
||||||
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
// Timer0 is already used for millis() - we'll just interrupt somewhere
|
||||||
// in the middle and call the "Compare A" function above
|
// in the middle and call the "Compare A" function above
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#include <Adafruit_GPS.h>
|
#include <Adafruit_GPS.h>
|
||||||
|
|
||||||
static boolean strStartsWith(const char *str, const char *prefix);
|
static bool strStartsWith(const char *str, const char *prefix);
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -41,7 +41,7 @@ static boolean strStartsWith(const char *str, const char *prefix);
|
||||||
@return True if well formed, false if it has problems
|
@return True if well formed, false if it has problems
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::check(char *nmea) {
|
bool Adafruit_GPS::check(char *nmea) {
|
||||||
thisCheck = 0; // new check
|
thisCheck = 0; // new check
|
||||||
if (*nmea != '$')
|
if (*nmea != '$')
|
||||||
return false; // doesn't start with $
|
return false; // doesn't start with $
|
||||||
|
|
@ -232,7 +232,7 @@ void Adafruit_GPS::parseLat(char *p) {
|
||||||
@return True if we parsed it, false if it has invalid data
|
@return True if we parsed it, false if it has invalid data
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::parseLatDir(char *p) {
|
bool Adafruit_GPS::parseLatDir(char *p) {
|
||||||
if (p[0] == 'S') {
|
if (p[0] == 'S') {
|
||||||
lat = 'S';
|
lat = 'S';
|
||||||
latitudeDegrees *= -1.0;
|
latitudeDegrees *= -1.0;
|
||||||
|
|
@ -281,7 +281,7 @@ void Adafruit_GPS::parseLon(char *p) {
|
||||||
@return True if we parsed it, false if it has invalid data
|
@return True if we parsed it, false if it has invalid data
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::parseLonDir(char *p) {
|
bool Adafruit_GPS::parseLonDir(char *p) {
|
||||||
if (!isEmpty(p)) {
|
if (!isEmpty(p)) {
|
||||||
if (p[0] == 'W') {
|
if (p[0] == 'W') {
|
||||||
lon = 'W';
|
lon = 'W';
|
||||||
|
|
@ -305,7 +305,7 @@ boolean Adafruit_GPS::parseLonDir(char *p) {
|
||||||
@return True if we parsed it, false if it has invalid data
|
@return True if we parsed it, false if it has invalid data
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::parseFix(char *p) {
|
bool Adafruit_GPS::parseFix(char *p) {
|
||||||
if (p[0] == 'A') {
|
if (p[0] == 'A') {
|
||||||
fix = true;
|
fix = true;
|
||||||
lastFix = sentTime;
|
lastFix = sentTime;
|
||||||
|
|
@ -601,7 +601,7 @@ void Adafruit_GPS::common_init(void) {
|
||||||
hour = minute = seconds = year = month = day = fixquality = fixquality_3d =
|
hour = minute = seconds = year = month = day = fixquality = fixquality_3d =
|
||||||
satellites = 0; // uint8_t
|
satellites = 0; // uint8_t
|
||||||
lat = lon = mag = 0; // char
|
lat = lon = mag = 0; // char
|
||||||
fix = false; // boolean
|
fix = false; // bool
|
||||||
milliseconds = 0; // uint16_t
|
milliseconds = 0; // uint16_t
|
||||||
latitude = longitude = geoidheight = altitude = speed = angle = magvariation =
|
latitude = longitude = geoidheight = altitude = speed = angle = magvariation =
|
||||||
HDOP = VDOP = PDOP = 0.0; // nmea_float_t
|
HDOP = VDOP = PDOP = 0.0; // nmea_float_t
|
||||||
|
|
@ -661,7 +661,7 @@ void Adafruit_GPS::sendCommand(const char *str) { println(str); }
|
||||||
@return True if received, false if not
|
@return True if received, false if not
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::newNMEAreceived(void) { return recvdflag; }
|
bool Adafruit_GPS::newNMEAreceived(void) { return recvdflag; }
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -669,7 +669,7 @@ boolean Adafruit_GPS::newNMEAreceived(void) { return recvdflag; }
|
||||||
@param p True = pause, false = unpause
|
@param p True = pause, false = unpause
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
void Adafruit_GPS::pause(boolean p) { paused = p; }
|
void Adafruit_GPS::pause(bool p) { paused = p; }
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -714,8 +714,8 @@ uint8_t Adafruit_GPS::parseHex(char c) {
|
||||||
@return True if we got what we wanted, false otherwise
|
@return True if we got what we wanted, false otherwise
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::waitForSentence(const char *wait4me, uint8_t max,
|
bool Adafruit_GPS::waitForSentence(const char *wait4me, uint8_t max,
|
||||||
boolean usingInterrupts) {
|
bool usingInterrupts) {
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
while (i < max) {
|
while (i < max) {
|
||||||
if (!usingInterrupts)
|
if (!usingInterrupts)
|
||||||
|
|
@ -739,7 +739,7 @@ boolean Adafruit_GPS::waitForSentence(const char *wait4me, uint8_t max,
|
||||||
@return True on success, false if it failed
|
@return True on success, false if it failed
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::LOCUS_StartLogger(void) {
|
bool Adafruit_GPS::LOCUS_StartLogger(void) {
|
||||||
sendCommand(PMTK_LOCUS_STARTLOG);
|
sendCommand(PMTK_LOCUS_STARTLOG);
|
||||||
recvdflag = false;
|
recvdflag = false;
|
||||||
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
|
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
|
||||||
|
|
@ -751,7 +751,7 @@ boolean Adafruit_GPS::LOCUS_StartLogger(void) {
|
||||||
@return True on success, false if it failed
|
@return True on success, false if it failed
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::LOCUS_StopLogger(void) {
|
bool Adafruit_GPS::LOCUS_StopLogger(void) {
|
||||||
sendCommand(PMTK_LOCUS_STOPLOG);
|
sendCommand(PMTK_LOCUS_STOPLOG);
|
||||||
recvdflag = false;
|
recvdflag = false;
|
||||||
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
|
return waitForSentence(PMTK_LOCUS_STARTSTOPACK);
|
||||||
|
|
@ -763,7 +763,7 @@ boolean Adafruit_GPS::LOCUS_StopLogger(void) {
|
||||||
@return True if we read the data, false if there was no response
|
@return True if we read the data, false if there was no response
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::LOCUS_ReadStatus(void) {
|
bool Adafruit_GPS::LOCUS_ReadStatus(void) {
|
||||||
sendCommand(PMTK_LOCUS_QUERY_STATUS);
|
sendCommand(PMTK_LOCUS_QUERY_STATUS);
|
||||||
|
|
||||||
if (!waitForSentence("$PMTKLOG"))
|
if (!waitForSentence("$PMTKLOG"))
|
||||||
|
|
@ -815,7 +815,7 @@ boolean Adafruit_GPS::LOCUS_ReadStatus(void) {
|
||||||
@return False if already in standby, true if it entered standby
|
@return False if already in standby, true if it entered standby
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::standby(void) {
|
bool Adafruit_GPS::standby(void) {
|
||||||
if (inStandbyMode) {
|
if (inStandbyMode) {
|
||||||
return false; // Returns false if already in standby mode, so that you do
|
return false; // Returns false if already in standby mode, so that you do
|
||||||
// not wake it up by sending commands to GPS
|
// not wake it up by sending commands to GPS
|
||||||
|
|
@ -834,7 +834,7 @@ boolean Adafruit_GPS::standby(void) {
|
||||||
@return True if woken up, false if not in standby or failed to wake
|
@return True if woken up, false if not in standby or failed to wake
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::wakeup(void) {
|
bool Adafruit_GPS::wakeup(void) {
|
||||||
if (inStandbyMode) {
|
if (inStandbyMode) {
|
||||||
inStandbyMode = false;
|
inStandbyMode = false;
|
||||||
sendCommand(""); // send byte to wake it up
|
sendCommand(""); // send byte to wake it up
|
||||||
|
|
@ -852,7 +852,7 @@ boolean Adafruit_GPS::wakeup(void) {
|
||||||
@return True if str starts with prefix, false otherwise
|
@return True if str starts with prefix, false otherwise
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
static boolean strStartsWith(const char *str, const char *prefix) {
|
static bool strStartsWith(const char *str, const char *prefix) {
|
||||||
while (*prefix) {
|
while (*prefix) {
|
||||||
if (*prefix++ != *str++)
|
if (*prefix++ != *str++)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -85,12 +85,12 @@ public:
|
||||||
Adafruit_GPS(SPIClass *theSPI, int8_t cspin); // Constructor when using SPI
|
Adafruit_GPS(SPIClass *theSPI, int8_t cspin); // Constructor when using SPI
|
||||||
|
|
||||||
char *lastNMEA(void);
|
char *lastNMEA(void);
|
||||||
boolean newNMEAreceived();
|
bool newNMEAreceived();
|
||||||
void common_init(void);
|
void common_init(void);
|
||||||
|
|
||||||
void sendCommand(const char *);
|
void sendCommand(const char *);
|
||||||
|
|
||||||
void pause(boolean b);
|
void pause(bool b);
|
||||||
|
|
||||||
uint8_t parseHex(char c);
|
uint8_t parseHex(char c);
|
||||||
|
|
||||||
|
|
@ -98,16 +98,16 @@ public:
|
||||||
size_t write(uint8_t);
|
size_t write(uint8_t);
|
||||||
size_t available(void);
|
size_t available(void);
|
||||||
|
|
||||||
boolean check(char *nmea);
|
bool check(char *nmea);
|
||||||
boolean parse(char *);
|
bool parse(char *);
|
||||||
void addChecksum(char *buff);
|
void addChecksum(char *buff);
|
||||||
nmea_float_t secondsSinceFix();
|
nmea_float_t secondsSinceFix();
|
||||||
nmea_float_t secondsSinceTime();
|
nmea_float_t secondsSinceTime();
|
||||||
nmea_float_t secondsSinceDate();
|
nmea_float_t secondsSinceDate();
|
||||||
void resetSentTime();
|
void resetSentTime();
|
||||||
|
|
||||||
boolean wakeup(void);
|
bool wakeup(void);
|
||||||
boolean standby(void);
|
bool standby(void);
|
||||||
|
|
||||||
int thisCheck = 0; ///< the results of the check on the current sentence
|
int thisCheck = 0; ///< the results of the check on the current sentence
|
||||||
char thisSource[NMEA_MAX_SOURCE_ID] = {
|
char thisSource[NMEA_MAX_SOURCE_ID] = {
|
||||||
|
|
@ -157,16 +157,16 @@ public:
|
||||||
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?
|
bool 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
|
||||||
|
|
||||||
boolean waitForSentence(const char *wait, uint8_t max = MAXWAITSENTENCE,
|
bool waitForSentence(const char *wait, uint8_t max = MAXWAITSENTENCE,
|
||||||
boolean usingInterrupts = false);
|
bool usingInterrupts = false);
|
||||||
boolean LOCUS_StartLogger(void);
|
bool LOCUS_StartLogger(void);
|
||||||
boolean LOCUS_StopLogger(void);
|
bool LOCUS_StopLogger(void);
|
||||||
boolean LOCUS_ReadStatus(void);
|
bool LOCUS_ReadStatus(void);
|
||||||
|
|
||||||
uint16_t LOCUS_serial; ///< Log serial number
|
uint16_t LOCUS_serial; ///< Log serial number
|
||||||
uint16_t LOCUS_records; ///< Log number of data record
|
uint16_t LOCUS_records; ///< Log number of data record
|
||||||
|
|
@ -197,10 +197,10 @@ private:
|
||||||
bool isEmpty(char *pStart);
|
bool isEmpty(char *pStart);
|
||||||
void parseTime(char *);
|
void parseTime(char *);
|
||||||
void parseLat(char *);
|
void parseLat(char *);
|
||||||
boolean parseLatDir(char *);
|
bool parseLatDir(char *);
|
||||||
void parseLon(char *);
|
void parseLon(char *);
|
||||||
boolean parseLonDir(char *);
|
bool parseLonDir(char *);
|
||||||
boolean parseFix(char *);
|
bool parseFix(char *);
|
||||||
// used by check() for validity tests, room for future expansion
|
// used by check() for validity tests, room for future expansion
|
||||||
const char *sources[5] = {"II", "WI", "GP", "GN",
|
const char *sources[5] = {"II", "WI", "GP", "GN",
|
||||||
"ZZZ"}; ///< valid source ids
|
"ZZZ"}; ///< valid source ids
|
||||||
|
|
@ -220,7 +220,7 @@ private:
|
||||||
2000000000L; ///< millis() when last full sentence received
|
2000000000L; ///< millis() when last full sentence received
|
||||||
uint32_t sentTime = 2000000000L; ///< millis() when first character of last
|
uint32_t sentTime = 2000000000L; ///< millis() when first character of last
|
||||||
///< full sentence received
|
///< full sentence received
|
||||||
boolean paused;
|
bool paused;
|
||||||
|
|
||||||
uint8_t parseResponse(char *response);
|
uint8_t parseResponse(char *response);
|
||||||
#if (defined(__AVR__) || defined(ESP8266)) && defined(USE_SW_SERIAL)
|
#if (defined(__AVR__) || defined(ESP8266)) && defined(USE_SW_SERIAL)
|
||||||
|
|
@ -242,11 +242,11 @@ private:
|
||||||
volatile char line1[MAXLINELENGTH]; ///< We double buffer: read one line in
|
volatile char line1[MAXLINELENGTH]; ///< We double buffer: read one line in
|
||||||
///< and leave one for the main program
|
///< and leave one for the main program
|
||||||
volatile char line2[MAXLINELENGTH]; ///< Second buffer
|
volatile char line2[MAXLINELENGTH]; ///< Second buffer
|
||||||
volatile uint8_t lineidx = 0; ///< our index into filling the current line
|
volatile uint8_t lineidx = 0; ///< our index into filling the current line
|
||||||
volatile char *currentline; ///< Pointer to current line buffer
|
volatile char *currentline; ///< Pointer to current line buffer
|
||||||
volatile char *lastline; ///< Pointer to previous line buffer
|
volatile char *lastline; ///< Pointer to previous line buffer
|
||||||
volatile boolean recvdflag; ///< Received flag
|
volatile bool recvdflag; ///< Received flag
|
||||||
volatile boolean inStandbyMode; ///< In standby flag
|
volatile bool inStandbyMode; ///< In standby flag
|
||||||
};
|
};
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
data
|
data
|
||||||
*/
|
*/
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
boolean Adafruit_GPS::parse(char *nmea) {
|
bool Adafruit_GPS::parse(char *nmea) {
|
||||||
// do checksum check
|
// do checksum check
|
||||||
if (!check(nmea))
|
if (!check(nmea))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -228,4 +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