Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module"
sourceType: "module",
},
extends: ["plugin:vue/recommended"],
env: {
node: true,
jquery: true,
es2017: true,
browser: true,
webextensions: true
webextensions: true,
},
rules: {
"no-trailing-spaces": "error",
"eol-last": "error",
semi: "error"
}
}
semi: "error",
"comma-dangle": ["error", "always-multiline"],
},
};
6 changes: 3 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ function dist_rollup() {
// accordingly inside of `dist`
entryFileNames: '[name].js',
dir: DIST_DIR,
})
}),
);
}

Expand Down Expand Up @@ -559,7 +559,7 @@ function injectARMCache(flavor, done) {
process.exit(1);
}
done();
}
},
);
}
});
Expand Down Expand Up @@ -828,7 +828,7 @@ function release_osx64(appDirectory) {
},
},
},
})
}),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ class MotorOutputReorderConfig
ArmWidth: 0.1 * screenSize,
Motors:
[
{x: -frameRadius, y: 0,},
{x: frameRadius, y: 0,},
{x: -frameRadius, y: 0},
{x: frameRadius, y: 0},
],
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Analytics = function (trackingId, userId, appName, appVersion, gitRevision
this._googleAnalytics.initialize(this._trackingId, {
storage: 'none',
clientId: userId,
debug: !!debugMode
debug: !!debugMode,
});

// Make it work for the Chrome App:
Expand Down
4 changes: 2 additions & 2 deletions src/js/Beepers.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class Beepers {
beepers.push(
{ bit: 19, name: 'CRASH_FLIP', visible: true },
{ bit: 20, name: 'CAM_CONNECTION_OPEN', visible: true },
{ bit: 21, name: 'CAM_CONNECTION_CLOSE', visible: true }
{ bit: 21, name: 'CAM_CONNECTION_CLOSE', visible: true },
);
}

if (semver.gte(config.apiVersion, API_VERSION_1_39)) {
beepers.push(
{ bit: 22, name: 'RC_SMOOTHING_INIT_FAIL', visible: true }
{ bit: 22, name: 'RC_SMOOTHING_INIT_FAIL', visible: true },
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/CliAutoComplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ CliAutoComplete._initTextcomplete = function() {
}, 0);
}
},
}
},
)
.on('textComplete:show', function() {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/Clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Clipboard = {
readAvailable : null,
writeAvailable : null,
writeText : null,
readText : null
readText : null,
};

Clipboard._configureClipboardAsNwJs = function(nwGui) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/ConfigInserter.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function seek(firmware, address) {
for (; index < firmware.data.length && address >= firmware.data[index].address + firmware.data[index].bytes; index++);

const result = {
lineIndex: index
lineIndex: index,
};

if (firmware.data[index] && address >= firmware.data[index].address) {
Expand Down Expand Up @@ -67,7 +67,7 @@ function generateData(firmware, input, startAddress) {
const line = {
address: address,
bytes: BLOCK_SIZE > remaining ? remaining : BLOCK_SIZE,
data: []
data: [],
};

if (firmware.data[index.lineIndex] && (line.address + line.bytes) > firmware.data[index.lineIndex].address) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/ConfigStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ const ConfigStorage = {
tmpObj[element] = input[element];
window.localStorage.setItem(element, JSON.stringify(tmpObj));
});
}
},
};
28 changes: 14 additions & 14 deletions src/js/Features.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,85 +18,85 @@ const Features = function (config) {
{bit: 14, group: 'rxMode', mode: 'select', name: 'RX_MSP'},
{bit: 15, group: 'rssi', name: 'RSSI_ADC'},
{bit: 16, group: 'other', name: 'LED_STRIP'},
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true}
{bit: 17, group: 'other', name: 'DISPLAY', haveTip: true},
];

if (!semver.gte(config.apiVersion, API_VERSION_1_33)) {
features.push(
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true}
{bit: 19, group: 'other', name: 'BLACKBOX', haveTip: true},
);
}

if (semver.gte(config.apiVersion, "1.12.0")) {
features.push(
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'}
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING'},
);
}

if (semver.gte(FC.CONFIG.apiVersion, "1.15.0") && !semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true}
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', haveTip: true},
);
}

if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true}
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true},
);
}

if (config.flightControllerVersion !== '') {
if (semver.gte(FC.CONFIG.apiVersion, "1.16.0")) {
features.push(
{bit: 22, group: 'other', name: 'AIRMODE'}
{bit: 22, group: 'other', name: 'AIRMODE'},
);
}

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'}
{bit: 23, group: 'superexpoRates', name: 'SUPEREXPO_RATES'},
);
} else if (!semver.gte(config.apiVersion, API_VERSION_1_33)) {
features.push(
{bit: 23, group: 'other', name: 'SDCARD'}
{bit: 23, group: 'other', name: 'SDCARD'},
);
}
}

if (semver.gte(FC.CONFIG.apiVersion, "1.20.0")) {
features.push(
{bit: 18, group: 'other', name: 'OSD'}
{bit: 18, group: 'other', name: 'OSD'},
);
if (!semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_35)) {
features.push(
{bit: 24, group: 'other', name: 'VTX'}
{bit: 24, group: 'other', name: 'VTX'},
);
}
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_31)) {
features.push(
{bit: 25, group: 'rxMode', mode: 'select', name: 'RX_SPI'},
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'}
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'},
);
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true}
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true},
);
if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_44)) { // DYNAMIC_FILTER got removed from FEATURES in BF 4.3 / API 1.44
features.push(
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'}
{bit: 29, group: 'other', name: 'DYNAMIC_FILTER'},
);
}
}

if (!semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_36)) {
features.push(
{bit: 1, group: 'batteryVoltage', name: 'VBAT'},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'}
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER'},
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/LogoManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ LogoManager.replaceLogoInFont = function (img) {
x * this.font.constants.SIZES.CHAR_WIDTH,
y * this.font.constants.SIZES.CHAR_HEIGHT,
this.font.constants.SIZES.CHAR_WIDTH,
this.font.constants.SIZES.CHAR_HEIGHT
this.font.constants.SIZES.CHAR_HEIGHT,
),
newChar = imageToCharacter.apply(this, [imageData.data]);
replaceChar.apply(this, [newChar, charAddr]);
Expand Down
36 changes: 18 additions & 18 deletions src/js/backup_restore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function configuration_backup(callback) {
MSPCodes.MSP_ACC_TRIM,
MSPCodes.MSP_SERVO_CONFIGURATIONS,
MSPCodes.MSP_MODE_RANGES,
MSPCodes.MSP_ADJUSTMENT_RANGES
MSPCodes.MSP_ADJUSTMENT_RANGES,
];

function update_profile_specific_data_list() {
Expand Down Expand Up @@ -71,7 +71,7 @@ function configuration_backup(callback) {
'ServoConfig': jQuery.extend(true, [], FC.SERVO_CONFIG),
'ServoRules': jQuery.extend(true, [], FC.SERVO_RULES),
'ModeRanges': jQuery.extend(true, [], FC.MODE_RANGES),
'AdjustmentRanges': jQuery.extend(true, [], FC.ADJUSTMENT_RANGES)
'AdjustmentRanges': jQuery.extend(true, [], FC.ADJUSTMENT_RANGES),
});

if (semver.gte(FC.CONFIG.apiVersion, "1.15.0")) {
Expand All @@ -96,7 +96,7 @@ function configuration_backup(callback) {
MSPCodes.MSP_RX_MAP,
MSPCodes.MSP_CF_SERIAL_CONFIG,
MSPCodes.MSP_LED_STRIP_CONFIG,
MSPCodes.MSP_LED_COLORS
MSPCodes.MSP_LED_COLORS,
];

function update_unique_data_list() {
Expand Down Expand Up @@ -211,7 +211,7 @@ function configuration_backup(callback) {
const filename = generateFilename(prefix, suffix);

const accepts = [{
description: suffix.toUpperCase() + ' files', extensions: [suffix]
description: suffix.toUpperCase() + ' files', extensions: [suffix],
}];

// create or load the file
Expand Down Expand Up @@ -282,7 +282,7 @@ function configuration_restore(callback) {
let chosenFileEntry = null;

const accepts = [{
description: 'JSON files', extensions: ['json']
description: 'JSON files', extensions: ['json'],
}];

// load up the file
Expand Down Expand Up @@ -396,7 +396,7 @@ function configuration_restore(callback) {
if (!configuration.PIDs && configuration.PID) {
configuration.PIDs = configuration.PID;
configuration.PID = {
controller: 0 // assume pid controller 0 was used.
controller: 0, // assume pid controller 0 was used.
};
}

Expand Down Expand Up @@ -484,7 +484,7 @@ function configuration_restore(callback) {
ports.push(newPort);
}
configuration.SERIAL_CONFIG = {
ports: ports
ports: ports,
};

GUI.log(i18n.getMessage('configMigratedTo', [migratedVersion]));
Expand All @@ -496,14 +496,14 @@ function configuration_restore(callback) {

if (configuration.FC_CONFIG == undefined) {
configuration.FC_CONFIG = {
loopTime: 3500
loopTime: 3500,
};
}

if (configuration.ARMING_CONFIG == undefined) {
configuration.ARMING_CONFIG = {
auto_disarm_delay: 5,
disarm_kill_switch: 1
disarm_kill_switch: 1,
};
}

Expand Down Expand Up @@ -578,7 +578,7 @@ function configuration_restore(callback) {
deadband3d_low: 1406,
deadband3d_high: 1514,
neutral: 1460,
deadband3d_throttle: 50
deadband3d_throttle: 50,
};
}

Expand All @@ -603,7 +603,7 @@ function configuration_restore(callback) {
configuration.SENSOR_ALIGNMENT = {
align_gyro: 0,
align_acc: 0,
align_mag: 0
align_mag: 0,
};
}

Expand All @@ -617,7 +617,7 @@ function configuration_restore(callback) {
stick_min: 1100,
stick_max: 1900,
rx_min_usec: 885,
rx_max_usec: 2115
rx_max_usec: 2115,
};
}

Expand All @@ -628,7 +628,7 @@ function configuration_restore(callback) {
failsafe_throttle: 1000,
failsafe_switch_mode: 0,
failsafe_throttle_low_delay: 100,
failsafe_procedure: 0
failsafe_procedure: 0,
};
}

Expand All @@ -637,13 +637,13 @@ function configuration_restore(callback) {
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 1500},
{mode: 0, value: 875}
{mode: 0, value: 875},
];

for (let i = 0; i < 14; i++) {
const rxfailChannel = {
mode: 1,
value: 1500
value: 1500,
};
configuration.RXFAIL_CONFIG.push(rxfailChannel);
}
Expand Down Expand Up @@ -698,7 +698,7 @@ function configuration_restore(callback) {
MSPCodes.MSP_SET_PID_CONTROLLER,
MSPCodes.MSP_SET_PID,
MSPCodes.MSP_SET_RC_TUNING,
MSPCodes.MSP_SET_ACC_TRIM
MSPCodes.MSP_SET_ACC_TRIM,
];

if (semver.gte(FC.CONFIG.apiVersion, "1.15.0")) {
Expand Down Expand Up @@ -772,7 +772,7 @@ function configuration_restore(callback) {
const defaultModeRangeExtra = {
modeId: FC.MODE_RANGES[modeIndex].modeId,
modeLogic: 0,
linkedTo: 0
linkedTo: 0,
};
FC.MODE_RANGES_EXTRA.push(defaultModeRangeExtra);
}
Expand All @@ -797,7 +797,7 @@ function configuration_restore(callback) {

const uniqueData = [
MSPCodes.MSP_SET_RX_MAP,
MSPCodes.MSP_SET_CF_SERIAL_CONFIG
MSPCodes.MSP_SET_CF_SERIAL_CONFIG,
];

function update_unique_data_list() {
Expand Down
Loading