mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 09:16:07 +03:00
minor fix: missing ifdef and autoconfig check
This commit is contained in:
parent
9c3d4603b7
commit
720d994a90
1 changed files with 15 additions and 11 deletions
|
@ -538,21 +538,25 @@ void gpsUpdate(timeUs_t currentTimeUs)
|
|||
// remove GPS from capability
|
||||
sensorsClear(SENSOR_GPS);
|
||||
gpsSetState(GPS_LOST_COMMUNICATION);
|
||||
#ifdef USE_GPS_UBLOX
|
||||
} else {
|
||||
if ((gpsData.messageState == GPS_MESSAGE_STATE_INITIALIZED) && STATE(GPS_FIX) && (gpsConfig()->gps_ublox_mode == UBLOX_DYNAMIC)) {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE;
|
||||
gpsData.state_position = 0;
|
||||
}
|
||||
if (gpsData.messageState == GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE) {
|
||||
if (gpsData.state_position < sizeof(ubloxAirborne)) {
|
||||
if (isSerialTransmitBufferEmpty(gpsPort)) {
|
||||
serialWrite(gpsPort, ubloxAirborne[gpsData.state_position]);
|
||||
gpsData.state_position++;
|
||||
if (gpsConfig()->autoConfig == GPS_AUTOCONFIG_ON) { // Only if autoconfig is enabled
|
||||
if ((gpsData.messageState == GPS_MESSAGE_STATE_INITIALIZED) && STATE(GPS_FIX) && (gpsConfig()->gps_ublox_mode == UBLOX_DYNAMIC)) {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE;
|
||||
gpsData.state_position = 0;
|
||||
}
|
||||
if (gpsData.messageState == GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE) {
|
||||
if (gpsData.state_position < sizeof(ubloxAirborne)) {
|
||||
if (isSerialTransmitBufferEmpty(gpsPort)) {
|
||||
serialWrite(gpsPort, ubloxAirborne[gpsData.state_position]);
|
||||
gpsData.state_position++;
|
||||
}
|
||||
} else {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_ENTRY_COUNT;
|
||||
}
|
||||
} else {
|
||||
gpsData.messageState = GPS_MESSAGE_STATE_ENTRY_COUNT;
|
||||
}
|
||||
}
|
||||
#endif //USE_GPS_UBLOX
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue