fix for GPS non-return

This commit is contained in:
ctzsnooze 2022-04-16 12:34:50 +10:00
parent f5a56804b1
commit fb51f63735
2 changed files with 10 additions and 8 deletions

View File

@ -985,7 +985,7 @@ void processRxModes(timeUs_t currentTimeUs)
}
#ifdef USE_GPS_RESCUE
if (ARMING_FLAG(ARMED) && IS_RC_MODE_ACTIVE(BOXGPSRESCUE)) {
if (ARMING_FLAG(ARMED) && (IS_RC_MODE_ACTIVE(BOXGPSRESCUE) || (failsafeIsActive() && failsafeConfig()->failsafe_procedure == FAILSAFE_PROCEDURE_GPS_RESCUE))) {
if (!FLIGHT_MODE(GPS_RESCUE_MODE)) {
ENABLE_FLIGHT_MODE(GPS_RESCUE_MODE);
}

View File

@ -653,15 +653,17 @@ void detectAndApplySignalLossBehaviour(void)
}
if (ARMING_FLAG(ARMED) && failsafeIsActive()) {
// apply failsafe values, until failsafe ends, or disarmed, unless in GPS Return
if ((channel < NON_AUX_CHANNEL_COUNT) && !FLIGHT_MODE(GPS_RESCUE_MODE)) {
if (channel == THROTTLE ) {
sample = failsafeConfig()->failsafe_throttle;
} else {
sample = rxConfig()->midrc;
// apply failsafe values, until failsafe ends, or disarmed, unless in GPS Return (where stick values should remain)
if (channel < NON_AUX_CHANNEL_COUNT) {
if (!FLIGHT_MODE(GPS_RESCUE_MODE)) {
if (channel == THROTTLE ) {
sample = failsafeConfig()->failsafe_throttle;
} else {
sample = rxConfig()->midrc;
}
}
} else if (!failsafeAuxSwitch) {
// aux channels as Set in Configurator, unless failsafe initiated by switch
// aux channels as Set in Configurator, unless failsafe initiated by switch
sample = getRxfailValue(channel);
}
} else {