mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Revert "BugFix: time to first fix was sometimes abnormally high due to improper configuration of Ublox GPS"
This reverts commit 751e1ae444
.
This commit is contained in:
parent
c9674fd488
commit
c08acd3eb4
2 changed files with 10 additions and 20 deletions
|
@ -416,9 +416,16 @@ void gpsInitUblox(void)
|
|||
}
|
||||
|
||||
if (gpsData.messageState == GPS_MESSAGE_STATE_INIT) {
|
||||
|
||||
if (gpsData.state_position < sizeof(ubloxInit)) {
|
||||
serialWrite(gpsPort, ubloxInit[gpsData.state_position]);
|
||||
if (gpsData.state_position < sizeof(ubloxAirborne)) {
|
||||
#if defined(GPS_UBLOX_MODE_PEDESTRIAN)
|
||||
serialWrite(gpsPort, ubloxInit[gpsData.state_position]);
|
||||
#else
|
||||
serialWrite(gpsPort, ubloxAirborne[gpsData.state_position]);
|
||||
#endif
|
||||
} else {
|
||||
serialWrite(gpsPort, ubloxInit[gpsData.state_position]);
|
||||
}
|
||||
gpsData.state_position++;
|
||||
} else {
|
||||
gpsData.state_position = 0;
|
||||
|
@ -449,7 +456,7 @@ void gpsInitUblox(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (gpsData.messageState >= GPS_MESSAGE_STATE_INITIALIZED) {
|
||||
if (gpsData.messageState >= GPS_MESSAGE_STATE_ENTRY_COUNT) {
|
||||
// ublox should be initialised, try receiving
|
||||
gpsSetState(GPS_RECEIVING_DATA);
|
||||
}
|
||||
|
@ -530,21 +537,6 @@ void gpsUpdate(timeUs_t currentTimeUs)
|
|||
// remove GPS from capability
|
||||
sensorsClear(SENSOR_GPS);
|
||||
gpsSetState(GPS_LOST_COMMUNICATION);
|
||||
#if !defined(GPS_UBLOX_MODE_PEDESTRIAN)
|
||||
} else {
|
||||
if ((gpsData.messageState == GPS_MESSAGE_STATE_IDLE) && STATE(GPS_FIX)) {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_AIRBORNE;
|
||||
gpsData.state_position = 0;
|
||||
}
|
||||
if (gpsData.messageState == GPS_MESSAGE_STATE_AIRBORNE) {
|
||||
if (gpsData.state_position < sizeof(ubloxAirborne)) {
|
||||
serialWrite(gpsPort, ubloxAirborne[gpsData.state_position]);
|
||||
gpsData.state_position++;
|
||||
} else {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_ENTRY_COUNT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -106,8 +106,6 @@ typedef enum {
|
|||
GPS_MESSAGE_STATE_INIT,
|
||||
GPS_MESSAGE_STATE_SBAS,
|
||||
GPS_MESSAGE_STATE_GALILEO,
|
||||
GPS_MESSAGE_STATE_INITIALIZED,
|
||||
GPS_MESSAGE_STATE_AIRBORNE,
|
||||
GPS_MESSAGE_STATE_ENTRY_COUNT
|
||||
} gpsMessageState_e;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue