diff --git a/flight/modules/GPS/UBX.c b/flight/modules/GPS/UBX.c index 25fc4d943..e6c027856 100644 --- a/flight/modules/GPS/UBX.c +++ b/flight/modules/GPS/UBX.c @@ -107,7 +107,7 @@ struct UBX_ACK_NAK ubxLastNak; #define UBX_PVT_TIMEOUT (1000) // parse incoming character stream for messages in UBX binary format -int parse_ubx_stream(uint8_t *rx, uint8_t len, char *gps_rx_buffer, GPSPositionSensorData *GpsData, struct GPS_RX_STATS *gpsRxStats) +int parse_ubx_stream(uint8_t *rx, uint16_t len, char *gps_rx_buffer, GPSPositionSensorData *GpsData, struct GPS_RX_STATS *gpsRxStats) { int ret = PARSER_INCOMPLETE; // message not (yet) complete enum proto_states { @@ -124,7 +124,7 @@ int parse_ubx_stream(uint8_t *rx, uint8_t len, char *gps_rx_buffer, GPSPositionS }; uint8_t c; static enum proto_states proto_state = START; - static uint8_t rx_count = 0; + static uint16_t rx_count = 0; struct UBXPacket *ubx = (struct UBXPacket *)gps_rx_buffer; for (int i = 0; i < len; i++) { diff --git a/flight/modules/GPS/inc/UBX.h b/flight/modules/GPS/inc/UBX.h index c83e00940..a7e938f46 100644 --- a/flight/modules/GPS/inc/UBX.h +++ b/flight/modules/GPS/inc/UBX.h @@ -311,7 +311,7 @@ struct UBX_NAV_SVINFO_SV { }; // SV information message -#define MAX_SVS 16 +#define MAX_SVS 32 struct UBX_NAV_SVINFO { uint32_t iTOW; // GPS Millisecond Time of Week (ms) @@ -405,7 +405,7 @@ extern struct UBX_ACK_NAK ubxLastNak; bool checksum_ubx_message(struct UBXPacket *); uint32_t parse_ubx_message(struct UBXPacket *, GPSPositionSensorData *); -int parse_ubx_stream(uint8_t *rx, uint8_t len, char *, GPSPositionSensorData *, struct GPS_RX_STATS *); +int parse_ubx_stream(uint8_t *rx, uint16_t len, char *, GPSPositionSensorData *, struct GPS_RX_STATS *); void load_mag_settings(); #endif /* UBX_H */