Check for valid PID_ADVANCED values

10.4.x-maintenance
Sean Moriarty 2018-06-28 13:36:54 -07:00 committed by Sean M
parent ef00402976
commit 70c839eb3a
3 changed files with 62 additions and 3 deletions

View File

@ -178,8 +178,64 @@ function configuration_backup(callback) {
}
}
// start fetching
fetch_unique_data_item();
if (GUI.configuration_loaded === true) {
return fetch_unique_data_item();
}
var promises = [ getAdvancedConfig(), getSensorConfig(), getCraftName(), getBoardAlignmentConfig(), getMixerConfig(), getBeeperConfig() ];
Promise.all(promises).
then(function () {
fetch_unique_data_item();
});
}
function getAdvancedConfig() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_ADVANCED_CONFIG, false, false, function() {
resolve();
});
});
}
function getSensorConfig() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_SENSOR_CONFIG, false, false, function() {
resolve();
});
});
}
function getCraftName() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_NAME, false, false, function() {
resolve();
});
});
}
function getBoardAlignmentConfig() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_BOARD_ALIGNMENT_CONFIG, false, false, function() {
resolve();
});
});
}
function getMixerConfig() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_MIXER_CONFIG, false, false, function() {
resolve();
});
});
}
function getBeeperConfig() {
return new Promise(function (resolve, reject) {
MSP.send_message(MSPCodes.MSP_BEEPER_CONFIG, false, false, function() {
resolve();
});
});
}
function save() {
@ -316,7 +372,7 @@ function configuration_restore(callback) {
GUI.log(i18n.getMessage('backupFileUnmigratable'));
return;
}
if (typeof configuration.FEATURE_CONFIG != 'undefined' && configuration.FEATURE_CONFIG.features._featureMask) {
if (configuration.FEATURE_CONFIG.features._featureMask) {
var features = new Features(CONFIG);
features.setMask(configuration.FEATURE_CONFIG.features._featureMask);
configuration.FEATURE_CONFIG.features = features;

View File

@ -43,6 +43,8 @@ function initializeSerialBackend() {
thisElement.data("clicks", !clicks);
};
GUI.configuration_loaded = false;
var selected_baud = parseInt($('div#port-picker #baud').val());
var selected_port = $('div#port-picker #port option:selected').data().isManual ?
$('#port-override').val() :

View File

@ -10,6 +10,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
if (GUI.active_tab != 'configuration') {
GUI.active_tab = 'configuration';
GUI.configuration_loaded = true;
}
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {