1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-17 05:15:21 +03:00

Added version gating (check on BF 3.1.0)

This commit is contained in:
Bas Delfos 2016-11-20 11:12:43 +01:00
parent 8aa40f1a2c
commit 2fb9a87906
2 changed files with 12 additions and 3 deletions

View file

@ -21,8 +21,7 @@ var Features = function (config) {
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
{bit: 16, group: 'other', name: 'LED_STRIP'},
{bit: 17, group: 'other', name: 'DISPLAY'},
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true},
{bit: 27, group: 'other', name: 'ESC_TELEMETRY'}
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
];
if (semver.gte(config.apiVersion, "1.12.0")) {
@ -65,6 +64,12 @@ var Features = function (config) {
{bit: 18, group: 'other', name: 'OSD'}
);
}
if (semver.gte(config.flightControllerVersion, "3.1.0")) {
features.push(
{bit: 27, group: 'other', name: 'ESC_TELEMETRY'}
)
}
}
self._features = features;

View file

@ -13,7 +13,6 @@ TABS.ports.initialize = function (callback, scrollPosition) {
{name: 'TELEMETRY_FRSKY', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
{name: 'TELEMETRY_HOTT', groups: ['telemetry'], sharableWith: ['msp'], notSharableWith: ['blackbox'], maxPorts: 1},
{name: 'TELEMETRY_SMARTPORT', groups: ['telemetry'], maxPorts: 1},
{name: 'TELEMETRY_ESC', groups: ['telemetry'], maxPorts: 1},
{name: 'RX_SERIAL', groups: ['rx'], maxPorts: 1},
{name: 'BLACKBOX', groups: ['logging', 'blackbox'], sharableWith: ['msp'], notSharableWith: ['telemetry'], maxPorts: 1},
];
@ -31,6 +30,11 @@ TABS.ports.initialize = function (callback, scrollPosition) {
functionRules.push(mavlinkFunctionRule);
}
if (semver.gte(CONFIG.flightControllerVersion, "3.1.0")) {
var escTlmFunctionRule = {name: 'TELEMETRY_ESC', groups: ['telemetry'], maxPorts: 1};
functionRules.push(escTlmFunctionRule);
}
for (var i = 0; i < functionRules.length; i++) {
functionRules[i].displayName = chrome.i18n.getMessage('portsFunction_' + functionRules[i].name);
}