mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-15 04:15:38 +03:00
Added GPS Valid Fix to programming
Added GPS Valid fix flight parameter. Also have set the GPS sats to 0 when a GPS sensor loss occurs. This is much more useful than a false reading.
This commit is contained in:
parent
2d07330d42
commit
4306010588
1 changed files with 10 additions and 1 deletions
|
@ -45,6 +45,7 @@
|
|||
#include "flight/pid.h"
|
||||
#include "drivers/io_port_expander.h"
|
||||
#include "io/osd_common.h"
|
||||
#include "sensors/diagnostics.h"
|
||||
|
||||
#include "navigation/navigation.h"
|
||||
#include "navigation/navigation_private.h"
|
||||
|
@ -408,7 +409,15 @@ static int logicConditionGetFlightOperandValue(int operand) {
|
|||
break;
|
||||
|
||||
case LOGIC_CONDITION_OPERAND_FLIGHT_GPS_SATS:
|
||||
return gpsSol.numSat;
|
||||
if (getHwGPSStatus() == HW_SENSOR_UNAVAILABLE || getHwGPSStatus() == HW_SENSOR_UNHEALTHY) {
|
||||
return 0;
|
||||
} else {
|
||||
return gpsSol.numSat;
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGIC_CONDITION_OPERAND_FLIGHT_GPS_VALID: // 0/1
|
||||
return STATE(GPS_FIX) ? 1 : 0;
|
||||
break;
|
||||
|
||||
case LOGIC_CONDITION_OPERAND_FLIGHT_GROUD_SPEED: // cm/s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue