From bf353192ef3f8a6987f61b59958dd9d0c1783d91 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Tue, 14 Apr 2015 13:29:22 +0100 Subject: [PATCH] Avoid backing up invalid looptime/arming configuration for firmware with api < 1.8 --- js/backup_restore.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/backup_restore.js b/js/backup_restore.js index 02460e27..f467dc0c 100644 --- a/js/backup_restore.js +++ b/js/backup_restore.js @@ -105,8 +105,11 @@ function configuration_backup(callback) { configuration.BF_CONFIG = jQuery.extend(true, {}, BF_CONFIG); configuration.SERIAL_CONFIG = jQuery.extend(true, {}, SERIAL_CONFIG); configuration.LED_STRIP = jQuery.extend(true, [], LED_STRIP); - configuration.FC_CONFIG = jQuery.extend(true, {}, FC_CONFIG); - configuration.ARMING_CONFIG = jQuery.extend(true, {}, ARMING_CONFIG); + + if (CONFIG.apiVersion >= 1.8) { + configuration.FC_CONFIG = jQuery.extend(true, {}, FC_CONFIG); + configuration.ARMING_CONFIG = jQuery.extend(true, {}, ARMING_CONFIG); + } save(); } @@ -430,7 +433,7 @@ function configuration_restore(callback) { } 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) { //reset it to the default configuration.FC_CONFIG.loopTime = 3500;