1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-27 16:54:15 +01:00

LP-145 reduce UBX false positive red X from 1 in 256 NMEA packets to 1 in 64k

This commit is contained in:
Cliff Geerdes 2015-11-15 18:13:51 -05:00
parent f0ef594cdb
commit 44a57cb308

View File

@ -143,7 +143,7 @@ int parse_ubx_stream(uint8_t *rx, uint16_t len, char *gps_rx_buffer, GPSPosition
if (c == UBX_SYNC2) { // second UBX sync char found if (c == UBX_SYNC2) { // second UBX sync char found
proto_state = UBX_CLASS; proto_state = UBX_CLASS;
} else { } else {
goto RESTART; // declare a packet error and reparse packet goto RESTART_NOERROR; // declare a packet error and reparse packet
} }
continue; continue;
case UBX_CLASS: case UBX_CLASS:
@ -214,9 +214,7 @@ int parse_ubx_stream(uint8_t *rx, uint16_t len, char *gps_rx_buffer, GPSPosition
// then we just restart at index 0, which is mid-packet, not the second byte // then we just restart at index 0, which is mid-packet, not the second byte
RESTART: RESTART:
ret = PARSER_ERROR; // inform caller that we found at least one error (along with 0 or more good packets) ret = PARSER_ERROR; // inform caller that we found at least one error (along with 0 or more good packets)
#if defined(PIOS_GPS_MINIMAL)
RESTART_NOERROR: RESTART_NOERROR:
#endif
rx += restart_index; // restart parsing just past the most recent SYNC1 rx += restart_index; // restart parsing just past the most recent SYNC1
len -= restart_index; len -= restart_index;
i = 0; i = 0;