1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Added dialog to offer resetting to custom defaults.

This commit is contained in:
mikeller 2019-09-13 01:50:59 +12:00
parent e1f6cb2be1
commit 6999656097
7 changed files with 82 additions and 10 deletions

View file

@ -34,6 +34,11 @@ function MspHelper () {
MSC_UTC: 3
};
self.RESET_TYPES = {
BASE_DEFAULTS: 0,
CUSTOM_DEFAULTS: 1,
};
self.SIGNATURE_LENGTH = 32;
self.mspMultipleCache = [];
@ -751,14 +756,14 @@ MspHelper.prototype.process_data = function(dataHandler) {
CONFIG.targetName = "";
if (semver.gte(CONFIG.apiVersion, "1.37.0")) {
CONFIG.commCapabilities = data.readU8();
CONFIG.targetCapabilities = data.readU8();
let length = data.readU8();
for (let i = 0; i < length; i++) {
CONFIG.targetName += String.fromCharCode(data.readU8());
}
} else {
CONFIG.commCapabilities = 0;
CONFIG.targetCapabilities = 0;
}
CONFIG.boardName = "";
@ -782,6 +787,10 @@ MspHelper.prototype.process_data = function(dataHandler) {
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
CONFIG.mcuTypeId = data.readU8();
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
CONFIG.configurationState = data.readU8();
}
} else {
CONFIG.mcuTypeId = 255;
}