Fix HDOP value needs to be rounded to the nearest hundred
This commit is contained in:
parent
0c2ac46741
commit
3ce8cffe7e
|
@ -763,7 +763,7 @@ void processSmartPortTelemetry(smartPortPayload_t *payload, volatile bool *clear
|
||||||
#ifdef USE_GPS
|
#ifdef USE_GPS
|
||||||
if (sensors(SENSOR_GPS)) {
|
if (sensors(SENSOR_GPS)) {
|
||||||
// satellite accuracy HDOP: 0 = worst [HDOP > 5.5m], 9 = best [HDOP <= 1.0m]
|
// satellite accuracy HDOP: 0 = worst [HDOP > 5.5m], 9 = best [HDOP <= 1.0m]
|
||||||
uint8_t hdop = constrain(scaleRange(gpsSol.hdop, 100, 550, 900, 0), 0, 900);
|
uint8_t hdop = constrain(scaleRange(gpsSol.hdop, 100, 550, 9, 0), 0, 9) * 100;
|
||||||
smartPortSendPackage(id, (STATE(GPS_FIX) ? 1000 : 0) + (STATE(GPS_FIX_HOME) ? 2000 : 0) + hdop + gpsSol.numSat);
|
smartPortSendPackage(id, (STATE(GPS_FIX) ? 1000 : 0) + (STATE(GPS_FIX_HOME) ? 2000 : 0) + hdop + gpsSol.numSat);
|
||||||
*clearToSend = false;
|
*clearToSend = false;
|
||||||
} else if (featureIsEnabled(FEATURE_GPS)) {
|
} else if (featureIsEnabled(FEATURE_GPS)) {
|
||||||
|
|
Loading…
Reference in New Issue