1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 01:35:28 +03:00

Merge branch 'add_extras_default_to_backup_restore' into add_mode_logic_to_msp

This commit is contained in:
Dave Huber 2019-02-08 16:45:14 -06:00
commit 6618ef5fb8

View file

@ -34,6 +34,9 @@ function configuration_backup(callback) {
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
profileSpecificData.push(MSPCodes.MSP_RC_DEADBAND);
}
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
profileSpecificData.push(MSPCodes.MSP_MODE_RANGES_EXTRA);
}
}
update_profile_specific_data_list();
@ -77,6 +80,9 @@ function configuration_backup(callback) {
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
configuration.profiles[fetchingProfile].RCdeadband = jQuery.extend(true, {}, RC_DEADBAND_CONFIG);
}
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
configuration.profiles[fetchingProfile].ModeRangesExtra = jQuery.extend(true, [], MODE_RANGES_EXTRA);
}
codeKey = 0;
fetchingProfile++;
@ -733,6 +739,21 @@ function configuration_restore(callback) {
MODE_RANGES = configuration.profiles[profile].ModeRanges;
ADJUSTMENT_RANGES = configuration.profiles[profile].AdjustmentRanges;
RC_DEADBAND_CONFIG = configuration.profiles[profile].RCdeadband;
if (configuration.profiles[profile].ModeRangesExtra == undefined) {
MODE_RANGES_EXTRA = [];
for (var modeIndex = 0; modeIndex < MODE_RANGES.length; modeIndex++) {
var defaultModeRangeExtra = {
modeId: MODE_RANGES[modeIndex].modeId,
modeLogic: 0,
linkedTo: 0
};
MODE_RANGES_EXTRA.push(defaultModeRangeExtra);
}
} else {
MODE_RANGES_EXTRA = configuration.profiles[profile].ModeRangesExtra;
}
}
function upload_using_specific_commands() {