mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-22 15:55:33 +03:00
Merge remote-tracking branch 'upstream/NewPIDFunctions' into NewPIDFunctions
Conflicts: js/backup_restore.js js/data_storage.js js/msp.js
This commit is contained in:
commit
c1a7452b27
25 changed files with 1413 additions and 114 deletions
|
@ -107,6 +107,9 @@ function configuration_backup(callback) {
|
|||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
uniqueData.push(MSP_codes.MSP_SENSOR_ALIGNMENT);
|
||||
uniqueData.push(MSP_codes.MSP_RX_CONFIG);
|
||||
uniqueData.push(MSP_codes.MSP_FAILSAFE_CONFIG);
|
||||
uniqueData.push(MSP_codes.MSP_RXFAIL_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,6 +140,9 @@ function configuration_backup(callback) {
|
|||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
configuration.SENSOR_ALIGNMENT = jQuery.extend(true, {}, SENSOR_ALIGNMENT);
|
||||
configuration.RX_CONFIG = jQuery.extend(true, {}, RX_CONFIG);
|
||||
configuration.FAILSAFE_CONFIG = jQuery.extend(true, {}, FAILSAFE_CONFIG);
|
||||
configuration.RXFAIL_CONFIG = jQuery.extend(true, [], RXFAIL_CONFIG);
|
||||
}
|
||||
|
||||
save();
|
||||
|
@ -544,6 +550,51 @@ function configuration_restore(callback) {
|
|||
appliedMigrationsCount++;
|
||||
}
|
||||
|
||||
// api 1.15 exposes RX_CONFIG, FAILSAFE_CONFIG and RXFAIL_CONFIG configuration
|
||||
|
||||
if (configuration.RX_CONFIG == undefined) {
|
||||
configuration.RX_CONFIG = {
|
||||
serialrx_provider: 0,
|
||||
spektrum_sat_bind: 0,
|
||||
midrc: 1500,
|
||||
mincheck: 1100,
|
||||
maxcheck: 1900,
|
||||
rx_min_usec: 885,
|
||||
rx_max_usec: 2115
|
||||
};
|
||||
}
|
||||
|
||||
if (configuration.FAILSAFE_CONFIG == undefined) {
|
||||
configuration.FAILSAFE_CONFIG = {
|
||||
failsafe_delay: 10,
|
||||
failsafe_off_delay: 200,
|
||||
failsafe_throttle: 1000,
|
||||
failsafe_kill_switch: 0,
|
||||
failsafe_throttle_low_delay: 100,
|
||||
failsafe_procedure: 0
|
||||
};
|
||||
}
|
||||
|
||||
if (configuration.RXFAIL_CONFIG == undefined) {
|
||||
configuration.RXFAIL_CONFIG = [
|
||||
{mode: 0, value: 1500},
|
||||
{mode: 0, value: 1500},
|
||||
{mode: 0, value: 1500},
|
||||
{mode: 0, value: 875}
|
||||
];
|
||||
|
||||
for (var i = 0; i < 14; i++) {
|
||||
var rxfailChannel = {
|
||||
mode: 1,
|
||||
value: 1500
|
||||
};
|
||||
configuration.RXFAIL_CONFIG.push(rxfailChannel);
|
||||
}
|
||||
}
|
||||
|
||||
appliedMigrationsCount++;
|
||||
}
|
||||
|
||||
if (appliedMigrationsCount > 0) {
|
||||
GUI.log(chrome.i18n.getMessage('configMigrationSuccessful', [appliedMigrationsCount]));
|
||||
}
|
||||
|
@ -661,6 +712,9 @@ function configuration_restore(callback) {
|
|||
}
|
||||
if (semver.gte(CONFIG.apiVersion, "1.15.0")) {
|
||||
uniqueData.push(MSP_codes.MSP_SET_SENSOR_ALIGNMENT);
|
||||
uniqueData.push(MSP_codes.MSP_SET_RX_CONFIG);
|
||||
uniqueData.push(MSP_codes.MSP_SET_FAILSAFE_CONFIG);
|
||||
uniqueData.push(MSP_codes.MSP_SET_RXFAIL_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -673,7 +727,10 @@ function configuration_restore(callback) {
|
|||
ARMING_CONFIG = configuration.ARMING_CONFIG;
|
||||
FC_CONFIG = configuration.FC_CONFIG;
|
||||
_3D = configuration._3D;
|
||||
SENSOR_ALIGNMENT = configuration.SENSOR_ALIGNMENT;
|
||||
SENSOR_ALIGNMENT = configuration.SENSOR_ALIGNMENT;
|
||||
RX_CONFIG = configuration.RX_CONFIG;
|
||||
FAILSAFE_CONFIG = configuration.FAILSAFE_CONFIG;
|
||||
RXFAIL_CONFIG = configuration.RXFAIL_CONFIG;
|
||||
}
|
||||
|
||||
function send_unique_data_item() {
|
||||
|
@ -726,4 +783,4 @@ function configuration_restore(callback) {
|
|||
|
||||
upload();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue