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

Move FC global vars inside FC object

This commit is contained in:
Miguel Angel Mulero Martinez 2020-07-06 08:05:27 +02:00
parent b9137a68e6
commit 24010a2e2a
32 changed files with 2799 additions and 2797 deletions

View file

@ -33,27 +33,27 @@ var Features = function (config) {
);
}
if (semver.gte(CONFIG.apiVersion, "1.15.0") && !semver.gte(CONFIG.apiVersion, "1.36.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.15.0") && !semver.gte(FC.CONFIG.apiVersion, "1.36.0")) {
features.push(
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true}
);
}
if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
);
}
if (config.flightControllerVersion !== '') {
if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 22, group: 'other', name: 'AIRMODE'}
);
}
if (semver.gte(CONFIG.apiVersion, "1.16.0")) {
if (semver.lt(CONFIG.apiVersion, "1.20.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
if (semver.lt(FC.CONFIG.apiVersion, "1.20.0")) {
features.push(
{bit: 23, group: 'superexpoRates', name: 'SUPEREXPO_RATES'}
);
@ -64,32 +64,32 @@ var Features = function (config) {
}
}
if (semver.gte(CONFIG.apiVersion, "1.20.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
features.push(
{bit: 18, group: 'other', name: 'OSD'}
);
if (!semver.gte(CONFIG.apiVersion, "1.35.0")) {
if (!semver.gte(FC.CONFIG.apiVersion, "1.35.0")) {
features.push(
{bit: 24, group: 'other', name: 'VTX'}
)
}
}
if (semver.gte(CONFIG.apiVersion, "1.31.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.31.0")) {
features.push(
{bit: 25, group: 'rxMode', mode: 'select', name: 'RX_SPI'},
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'}
);
}
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
if (semver.gte(FC.CONFIG.apiVersion, "1.36.0")) {
features.push(
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true},
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'}
);
}
if (!semver.gte(CONFIG.apiVersion, "1.36.0")) {
if (!semver.gte(FC.CONFIG.apiVersion, "1.36.0")) {
features.push(
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'}