mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 01:05:21 +03:00
inhibit failsafe on landing
This commit is contained in:
parent
9922e7d259
commit
af8a561ed0
2 changed files with 15 additions and 14 deletions
|
@ -3321,10 +3321,6 @@ void calculateFarAwayTarget(fpVector3_t * farAwayPos, int32_t bearing, int32_t d
|
|||
*-----------------------------------------------------------*/
|
||||
void updateLandingStatus(timeMs_t currentTimeMs)
|
||||
{
|
||||
if (STATE(AIRPLANE) && !navConfig()->general.flags.disarm_on_landing) {
|
||||
return; // no point using this with a fixed wing if not set to disarm
|
||||
}
|
||||
|
||||
static timeMs_t lastUpdateTimeMs = 0;
|
||||
if ((currentTimeMs - lastUpdateTimeMs) <= HZ2MS(100)) { // limit update to 100Hz
|
||||
return;
|
||||
|
@ -3354,8 +3350,13 @@ void updateLandingStatus(timeMs_t currentTimeMs)
|
|||
ENABLE_ARMING_FLAG(ARMING_DISABLED_LANDING_DETECTED);
|
||||
disarm(DISARM_LANDING);
|
||||
} else if (!navigationInAutomaticThrottleMode()) {
|
||||
// for multirotor only - reactivate landing detector without disarm when throttle raised toward hover throttle
|
||||
landingDetectorIsActive = rxGetChannelValue(THROTTLE) < (0.5 * (currentBatteryProfile->nav.mc.hover_throttle + getThrottleIdleValue()));
|
||||
if (STATE(AIRPLANE) && isFlightDetected()) {
|
||||
// Cancel landing detection flag if fixed wing redetected in flight
|
||||
resetLandingDetector();
|
||||
} else {
|
||||
// For multirotor - reactivate landing detector without disarm when throttle raised toward hover throttle
|
||||
landingDetectorIsActive = rxGetChannelValue(THROTTLE) < (0.5 * (currentBatteryProfile->nav.mc.hover_throttle + getThrottleIdleValue()));
|
||||
}
|
||||
}
|
||||
} else if (isLandingDetected()) {
|
||||
ENABLE_STATE(LANDING_DETECTED);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue