mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 12:25:13 +03:00
Avoid backing up invalid looptime/arming configuration for firmware with
api < 1.8
This commit is contained in:
parent
2398f10b62
commit
bf353192ef
1 changed files with 6 additions and 3 deletions
|
@ -105,8 +105,11 @@ function configuration_backup(callback) {
|
||||||
configuration.BF_CONFIG = jQuery.extend(true, {}, BF_CONFIG);
|
configuration.BF_CONFIG = jQuery.extend(true, {}, BF_CONFIG);
|
||||||
configuration.SERIAL_CONFIG = jQuery.extend(true, {}, SERIAL_CONFIG);
|
configuration.SERIAL_CONFIG = jQuery.extend(true, {}, SERIAL_CONFIG);
|
||||||
configuration.LED_STRIP = jQuery.extend(true, [], LED_STRIP);
|
configuration.LED_STRIP = jQuery.extend(true, [], LED_STRIP);
|
||||||
|
|
||||||
|
if (CONFIG.apiVersion >= 1.8) {
|
||||||
configuration.FC_CONFIG = jQuery.extend(true, {}, FC_CONFIG);
|
configuration.FC_CONFIG = jQuery.extend(true, {}, FC_CONFIG);
|
||||||
configuration.ARMING_CONFIG = jQuery.extend(true, {}, ARMING_CONFIG);
|
configuration.ARMING_CONFIG = jQuery.extend(true, {}, ARMING_CONFIG);
|
||||||
|
}
|
||||||
|
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
@ -430,7 +433,7 @@ function configuration_restore(callback) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compareVersions(migratedVersion, '0.63.0')) {
|
if (compareVersions(migratedVersion, '0.63.0')) {
|
||||||
// backups created with 0.63.0 for firmwares with api < 1.8.0 were saved with incorrect looptime
|
// backups created with 0.63.0 for firmwares with api < 1.8 were saved with incorrect looptime
|
||||||
if (configuration.FC_CONFIG.loopTime == 0) {
|
if (configuration.FC_CONFIG.loopTime == 0) {
|
||||||
//reset it to the default
|
//reset it to the default
|
||||||
configuration.FC_CONFIG.loopTime = 3500;
|
configuration.FC_CONFIG.loopTime = 3500;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue