mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 04:45:24 +03:00
Fix READY_BEEP
This commit is contained in:
parent
f4775292b6
commit
0bb5bca5a7
1 changed files with 16 additions and 0 deletions
|
@ -43,6 +43,7 @@
|
|||
#include "drivers/light_led.h"
|
||||
#include "drivers/time.h"
|
||||
|
||||
#include "io/beeper.h"
|
||||
#include "io/dashboard.h"
|
||||
#include "io/gps.h"
|
||||
#include "io/serial.h"
|
||||
|
@ -872,11 +873,26 @@ void gpsUpdate(timeUs_t currentTimeUs)
|
|||
if (!ARMING_FLAG(ARMED) && !gpsConfig()->gps_set_home_point_once) {
|
||||
DISABLE_STATE(GPS_FIX_HOME);
|
||||
}
|
||||
|
||||
uint8_t minSats = 5;
|
||||
|
||||
#if defined(USE_GPS_RESCUE)
|
||||
if (gpsRescueIsConfigured()) {
|
||||
updateGPSRescueState();
|
||||
minSats = gpsRescueConfig()->minSats;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool hasFix = false;
|
||||
if (STATE(GPS_FIX)) {
|
||||
if (gpsIsHealthy() && gpsSol.numSat >= minSats && !hasFix) {
|
||||
// ready beep sequence on fix or requirements for gps rescue met.
|
||||
beeper(BEEPER_READY_BEEP);
|
||||
hasFix = true;
|
||||
}
|
||||
} else {
|
||||
hasFix = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void gpsNewData(uint16_t c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue