1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Better detection for THR control from the NAV system

As requested by @digitalentity. Previous code was returning a
false positive on MC when only 2D position hold was active.
This commit is contained in:
Alberto García Hierro 2017-10-04 10:36:17 +01:00
parent 47fc453727
commit deb3385616

View file

@ -2695,7 +2695,8 @@ rthState_e getStateOfForcedRTH(void)
bool navigationIsControllingThrottle(void) bool navigationIsControllingThrottle(void)
{ {
return posControl.navState != NAV_STATE_IDLE; navigationFSMStateFlags_t stateFlags = navGetCurrentStateFlags();
return (stateFlags & (NAV_CTL_ALT | NAV_CTL_EMERG | NAV_CTL_LAUNCH | NAV_CTL_LAND)) || (STATE(FIXED_WING) && (stateFlags & (NAV_CTL_POS)));
} }
#else // NAV #else // NAV