Merge pull request #2832 from mikeller/gps_fix_from_cleanflight
Merge pull request #2699 from McGiverGim/make-gps-stable-again
This commit is contained in:
commit
f2c17e6a34
|
@ -435,7 +435,7 @@ void gpsUpdate(timeUs_t currentTimeUs)
|
|||
gpsData.baudrateIndex++;
|
||||
gpsData.baudrateIndex %= GPS_INIT_ENTRIES;
|
||||
}
|
||||
gpsData.lastMessage = currentTimeUs / 1000;
|
||||
gpsData.lastMessage = millis();
|
||||
// TODO - move some / all of these into gpsData
|
||||
GPS_numSat = 0;
|
||||
DISABLE_STATE(GPS_FIX);
|
||||
|
@ -444,7 +444,7 @@ void gpsUpdate(timeUs_t currentTimeUs)
|
|||
|
||||
case GPS_RECEIVING_DATA:
|
||||
// check for no data/gps timeout/cable disconnection etc
|
||||
if (currentTimeUs / 1000 - gpsData.lastMessage > GPS_TIMEOUT) {
|
||||
if (millis() - gpsData.lastMessage > GPS_TIMEOUT) {
|
||||
// remove GPS from capability
|
||||
sensorsClear(SENSOR_GPS);
|
||||
gpsSetState(GPS_LOST_COMMUNICATION);
|
||||
|
|
Loading…
Reference in New Issue