mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_GPS: adjust NMEA sentence length calculation
review feedback
This commit is contained in:
parent
3fe4b9c0f8
commit
4af857da44
@ -85,6 +85,8 @@ bool AP_GPS_NMEA::_decode(char c)
|
||||
{
|
||||
bool valid_sentence = false;
|
||||
|
||||
_sentence_length++;
|
||||
|
||||
switch (c) {
|
||||
case ',': // term terminators
|
||||
_parity ^= c;
|
||||
@ -99,7 +101,6 @@ bool AP_GPS_NMEA::_decode(char c)
|
||||
++_term_number;
|
||||
_term_offset = 0;
|
||||
_is_checksum_term = c == '*';
|
||||
_sentence_length++;
|
||||
return valid_sentence;
|
||||
|
||||
case '$': // sentence begin
|
||||
@ -108,7 +109,7 @@ bool AP_GPS_NMEA::_decode(char c)
|
||||
_sentence_type = _GPS_SENTENCE_OTHER;
|
||||
_is_checksum_term = false;
|
||||
_gps_data_good = false;
|
||||
_sentence_length = 0;
|
||||
_sentence_length = 1;
|
||||
return valid_sentence;
|
||||
}
|
||||
|
||||
@ -118,8 +119,6 @@ bool AP_GPS_NMEA::_decode(char c)
|
||||
if (!_is_checksum_term)
|
||||
_parity ^= c;
|
||||
|
||||
_sentence_length++;
|
||||
|
||||
return valid_sentence;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user