From 2ef9947dfd74b0fe1bc51b96ddcdd9814a70fb87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garci=CC=81a=20Hierro?= Date: Mon, 21 Aug 2017 00:20:42 +0200 Subject: [PATCH] Add support for FEATURE_AIRMODE in the Configuration tab Setting the feature also hides the mode from the modes tab, since the FC won't register the BOXID as an active one. FC support detection is based on INAV version >= 1.7.3, since support for the AIRMODE feature has been advertised by previous releases but it's not really supported (it does nothing). Support for INAV is at https://github.com/iNavFlight/inav/pull/1949 Fixes #154 --- _locales/en/messages.json | 3 +++ build/script.js | 6 ++++++ js/fc.js | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 6ad07bfd..5819b4b7 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -566,6 +566,9 @@ "featureOSD": { "message": "OSD" }, + "featureAIRMODE": { + "message": "Permanently enable AIRMODE" + }, "configurationFeatureEnabled": { "message": "Enabled" }, diff --git a/build/script.js b/build/script.js index 78e33bd9..b0b80116 100644 --- a/build/script.js +++ b/build/script.js @@ -11397,6 +11397,12 @@ var FC = { ); } + if (semver.gte(CONFIG.flightControllerVersion, '1.7.3')) { + features.push( + {bit: 22, group: 'other', name: 'AIRMODE', haveTip: false, showNameInTip: false} + ); + } + return features.reverse(); }, isFeatureEnabled: function (featureName, features) { diff --git a/js/fc.js b/js/fc.js index 3efcd1ee..397835f6 100644 --- a/js/fc.js +++ b/js/fc.js @@ -461,6 +461,12 @@ var FC = { ); } + if (semver.gte(CONFIG.flightControllerVersion, '1.7.3')) { + features.push( + {bit: 22, group: 'other', name: 'AIRMODE', haveTip: false, showNameInTip: false} + ); + } + return features.reverse(); }, isFeatureEnabled: function (featureName, features) {