Clear thisSentence and thisSource at start of each check

that way previous sentence identifiers won't bleed through on failure.
This commit is contained in:
Rick Sellens 2020-01-29 19:52:13 -05:00
parent 84eaad66e4
commit deb312b293
1 changed files with 1 additions and 0 deletions

View File

@ -545,6 +545,7 @@ bool Adafruit_GPS::parse(char *nmea) {
/**************************************************************************/ /**************************************************************************/
boolean Adafruit_GPS::check(char *nmea) { boolean Adafruit_GPS::check(char *nmea) {
thisCheck = 0; // new check thisCheck = 0; // new check
*thisSentence = *thisSource = 0;
if (*nmea != '$' && *nmea != '!') if (*nmea != '$' && *nmea != '!')
return false; // doesn't start with $ or ! return false; // doesn't start with $ or !
else else