From f4c07566db00f8a1a9667eaec032a65050f82099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Garci=CC=81a=20Hierro?= Date: Mon, 21 Aug 2017 00:55:28 +0200 Subject: [PATCH] Set MOTOR_STOP and AIRMODE features in all FW presets AIRMODE will only be set if INAV version is > 1.7.2, since it does nothing in previous versions even when the feature is advertised. --- build/script.js | 9 +++++++++ tabs/profiles.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/build/script.js b/build/script.js index 78e33bd9..9cdf6771 100644 --- a/build/script.js +++ b/build/script.js @@ -21444,6 +21444,15 @@ presets.model = (function () { } } + if (mixerType == 'airplane' || mixerType == 'flyingwing') { + // Always set MOTOR_STOP and feature AIRMODE for fixed wing + window.BF_CONFIG.features |= 1 << 4; // MOTOR_STOP + if (semver.gt(CONFIG.flightControllerVersion, '1.7.2')) { + // Note that feature_AIRMODE is only supported on + // INAV > 1.7.2. + window.BF_CONFIG.features |= 1 << 22; // AIRMODE + } + } }; self.extractPresetNames = function (presets) { diff --git a/tabs/profiles.js b/tabs/profiles.js index 5f146ee4..3ee310fb 100644 --- a/tabs/profiles.js +++ b/tabs/profiles.js @@ -406,6 +406,15 @@ presets.model = (function () { } } + if (mixerType == 'airplane' || mixerType == 'flyingwing') { + // Always set MOTOR_STOP and feature AIRMODE for fixed wing + window.BF_CONFIG.features |= 1 << 4; // MOTOR_STOP + if (semver.gt(CONFIG.flightControllerVersion, '1.7.2')) { + // Note that feature_AIRMODE is only supported on + // INAV > 1.7.2. + window.BF_CONFIG.features |= 1 << 22; // AIRMODE + } + } }; self.extractPresetNames = function (presets) {