diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 5b5801bc1..0c9c12fe5 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -68,6 +68,7 @@ #include "fc/rc.h" #include "fc/runtime_config.h" +#include "flight/gps_rescue.h" #include "flight/failsafe.h" #include "flight/position.h" #include "flight/imu.h" @@ -1328,11 +1329,13 @@ void osdUpdateAlarms(void) SET_BLINK(OSD_AVG_CELL_VOLTAGE); } - if (STATE(GPS_FIX) == 0) { +#ifdef USE_GPS + if ((STATE(GPS_FIX) == 0) || ((gpsSol.numSat < gpsRescueConfig()->minSats) && gpsRescueIsConfigured())) { SET_BLINK(OSD_GPS_SATS); } else { CLR_BLINK(OSD_GPS_SATS); } +#endif //USE_GPS for (int i = 0; i < OSD_TIMER_COUNT; i++) { const uint16_t timer = osdConfig()->timers[i]; diff --git a/src/test/unit/osd_unittest.cc b/src/test/unit/osd_unittest.cc index f0b436ee6..4d4324cf4 100644 --- a/src/test/unit/osd_unittest.cc +++ b/src/test/unit/osd_unittest.cc @@ -45,6 +45,7 @@ extern "C" { #include "fc/rc_modes.h" #include "fc/runtime_config.h" + #include "flight/gps_rescue.h" #include "flight/pid.h" #include "flight/imu.h" @@ -86,6 +87,7 @@ extern "C" { PG_REGISTER(blackboxConfig_t, blackboxConfig, PG_BLACKBOX_CONFIG, 0); PG_REGISTER(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 0); PG_REGISTER(pilotConfig_t, pilotConfig, PG_PILOT_CONFIG, 0); + PG_REGISTER(gpsRescueConfig_t, gpsRescueConfig, PG_GPS_RESCUE, 0); timeUs_t simulationTime = 0; batteryState_e simulationBatteryState; @@ -1076,4 +1078,5 @@ extern "C" { bool areMotorsRunning(void){ return true; } bool pidOsdAntiGravityActive(void) { return false; } bool failsafeIsActive(void) { return false; } + bool gpsRescueIsConfigured(void) { return false; } }