Browse Source

AP_GPS: Default the value of hdop to 99.99 if no value has been read yet.

master
Michael du Breuil 10 years ago committed by Randy Mackay
parent
commit
c704102dcd
  1. 3
      libraries/AP_GPS/AP_GPS.cpp

3
libraries/AP_GPS/AP_GPS.cpp

@ -212,6 +212,7 @@ AP_GPS::detect_instance(uint8_t instance)
state[instance].instance = instance; state[instance].instance = instance;
state[instance].status = NO_GPS; state[instance].status = NO_GPS;
state[instance].hdop = 9999;
// record the time when we started detection. This is used to try // record the time when we started detection. This is used to try
// to avoid initialising a uBlox as a NMEA GPS // to avoid initialising a uBlox as a NMEA GPS
@ -336,6 +337,7 @@ AP_GPS::update_instance(uint8_t instance)
if (_type[instance] == GPS_TYPE_NONE) { if (_type[instance] == GPS_TYPE_NONE) {
// not enabled // not enabled
state[instance].status = NO_GPS; state[instance].status = NO_GPS;
state[instance].hdop = 9999;
return; return;
} }
if (locked_ports & (1U<<instance)) { if (locked_ports & (1U<<instance)) {
@ -368,6 +370,7 @@ AP_GPS::update_instance(uint8_t instance)
memset(&state[instance], 0, sizeof(state[instance])); memset(&state[instance], 0, sizeof(state[instance]));
state[instance].instance = instance; state[instance].instance = instance;
state[instance].status = NO_GPS; state[instance].status = NO_GPS;
state[instance].hdop = 9999;
timing[instance].last_message_time_ms = tnow; timing[instance].last_message_time_ms = tnow;
} }
} else { } else {

Loading…
Cancel
Save