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

Respect feature AIRMODE

While the AIRMODE feature is available in the CLI, the current
code only takes BOXAIRMODE into account (triggered by an RC channel).

This PR introduces an isAirmodeActive() function which also returns
true when if the AIRMODE feature has been set, not only when BOXAIRMODE
is active. Checks for IS_RC_MODE_ACTIVE(BOXAIRMODE) have been replaced
by calls to isAirmodeActive().

This will allow adding a simple switch in the configurator, as
reported in https://github.com/iNavFlight/inav-configurator/issues/154.

Eventually, isAirmodeActive() might be modified to always
return true in FW, since there's no reason to disable it in FW
models AFAIK.
This commit is contained in:
Alberto García Hierro 2017-07-30 14:23:54 +01:00
parent c30819d8de
commit afc0a3d413
5 changed files with 15 additions and 7 deletions

View file

@ -51,6 +51,11 @@ bool isUsingSticksForArming(void)
return isUsingSticksToArm;
}
bool isAirmodeActive(void)
{
return feature(FEATURE_AIRMODE) || IS_RC_MODE_ACTIVE(BOXAIRMODE);
}
#if defined(NAV)
bool isUsingNavigationModes(void)
{