1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 01:35:41 +03:00

minor fix: missing ifdef and autoconfig check

This commit is contained in:
Tony Cabello 2020-03-21 16:25:25 +01:00
parent 9c3d4603b7
commit 720d994a90

View file

@ -538,21 +538,25 @@ void gpsUpdate(timeUs_t currentTimeUs)
// remove GPS from capability // remove GPS from capability
sensorsClear(SENSOR_GPS); sensorsClear(SENSOR_GPS);
gpsSetState(GPS_LOST_COMMUNICATION); gpsSetState(GPS_LOST_COMMUNICATION);
#ifdef USE_GPS_UBLOX
} else { } else {
if ((gpsData.messageState == GPS_MESSAGE_STATE_INITIALIZED) && STATE(GPS_FIX) && (gpsConfig()->gps_ublox_mode == UBLOX_DYNAMIC)) { if (gpsConfig()->autoConfig == GPS_AUTOCONFIG_ON) { // Only if autoconfig is enabled
gpsData.messageState = GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE; if ((gpsData.messageState == GPS_MESSAGE_STATE_INITIALIZED) && STATE(GPS_FIX) && (gpsConfig()->gps_ublox_mode == UBLOX_DYNAMIC)) {
gpsData.state_position = 0; 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 (gpsData.messageState == GPS_MESSAGE_STATE_PEDESTRIAN_TO_AIRBORNE) {
if (isSerialTransmitBufferEmpty(gpsPort)) { if (gpsData.state_position < sizeof(ubloxAirborne)) {
serialWrite(gpsPort, ubloxAirborne[gpsData.state_position]); if (isSerialTransmitBufferEmpty(gpsPort)) {
gpsData.state_position++; 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; break;
} }