mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Check for valid PID_ADVANCED values
This commit is contained in:
parent
ef00402976
commit
70c839eb3a
3 changed files with 62 additions and 3 deletions
|
@ -177,9 +177,65 @@ function configuration_backup(callback) {
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// start fetching
|
}
|
||||||
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() {
|
function save() {
|
||||||
|
@ -316,7 +372,7 @@ function configuration_restore(callback) {
|
||||||
GUI.log(i18n.getMessage('backupFileUnmigratable'));
|
GUI.log(i18n.getMessage('backupFileUnmigratable'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof configuration.FEATURE_CONFIG != 'undefined' && configuration.FEATURE_CONFIG.features._featureMask) {
|
if (configuration.FEATURE_CONFIG.features._featureMask) {
|
||||||
var features = new Features(CONFIG);
|
var features = new Features(CONFIG);
|
||||||
features.setMask(configuration.FEATURE_CONFIG.features._featureMask);
|
features.setMask(configuration.FEATURE_CONFIG.features._featureMask);
|
||||||
configuration.FEATURE_CONFIG.features = features;
|
configuration.FEATURE_CONFIG.features = features;
|
||||||
|
|
|
@ -43,6 +43,8 @@ function initializeSerialBackend() {
|
||||||
thisElement.data("clicks", !clicks);
|
thisElement.data("clicks", !clicks);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GUI.configuration_loaded = false;
|
||||||
|
|
||||||
var selected_baud = parseInt($('div#port-picker #baud').val());
|
var selected_baud = parseInt($('div#port-picker #baud').val());
|
||||||
var selected_port = $('div#port-picker #port option:selected').data().isManual ?
|
var selected_port = $('div#port-picker #port option:selected').data().isManual ?
|
||||||
$('#port-override').val() :
|
$('#port-override').val() :
|
||||||
|
|
|
@ -10,6 +10,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
if (GUI.active_tab != 'configuration') {
|
if (GUI.active_tab != 'configuration') {
|
||||||
GUI.active_tab = 'configuration';
|
GUI.active_tab = 'configuration';
|
||||||
|
GUI.configuration_loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
if (semver.lt(CONFIG.apiVersion, "1.36.0")) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue