From e6b5719cc461d13bb52fa3eae15a98a7ab9e8cd8 Mon Sep 17 00:00:00 2001 From: "Konstantin (DigitalEntity) Sharlaimov" Date: Thu, 2 Jan 2020 10:34:57 +0100 Subject: [PATCH] [DJI] Add support for DJI FPV goggles and SBUS Fast protocol --- _locales/en/messages.json | 3 +++ js/fc.js | 3 ++- js/msp/MSPHelper.js | 1 + tabs/ports.js | 9 +++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 045e18c7..503a2760 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -927,6 +927,9 @@ "portsFunction_FRSKY_OSD": { "message": "FrSky OSD" }, + "portsFunction_DJI_FPV": { + "message": "DJI FPV VTX" + }, "pidTuningName": { "message": "Name" }, diff --git a/js/fc.js b/js/fc.js index 964dbf97..418179ba 100644 --- a/js/fc.js +++ b/js/fc.js @@ -769,7 +769,8 @@ var FC = { 'IBUS', 'JETI EXBUS', 'TBS Crossfire', - 'FPort' + 'FPort', + 'SBUS Fast', ]; return data; diff --git a/js/msp/MSPHelper.js b/js/msp/MSPHelper.js index ce636389..e60766a4 100644 --- a/js/msp/MSPHelper.js +++ b/js/msp/MSPHelper.js @@ -52,6 +52,7 @@ var mspHelper = (function (gui) { 'ESC': 18, 'GSM_SMS': 19, 'FRSKY_OSD': 20, + 'DJI_FPV': 21, }; // Required for MSP_DEBUGMSG because console.log() doesn't allow omitting diff --git a/tabs/ports.js b/tabs/ports.js index bf4b07d0..253991f4 100644 --- a/tabs/ports.js +++ b/tabs/ports.js @@ -93,6 +93,15 @@ TABS.ports.initialize = function (callback) { ); } + if (semver.gte(CONFIG.flightControllerVersion, "2.4.0")) { + functionRules.push({ + name: 'DJI_FPV', + groups: ['peripherals'], + maxPorts: 1 } + ); + } + + for (var i = 0; i < functionRules.length; i++) { functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name); }