From 94537aa143ab9dede975fd9bd5ad6657b8033d79 Mon Sep 17 00:00:00 2001 From: "DrZiplok@gmail.com" Date: Mon, 21 Feb 2011 04:42:28 +0000 Subject: [PATCH] Increase the maximum save size to 64B, so that a Vector3f can be saved. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1704 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Common/AP_Var.cpp | 1 - libraries/AP_Common/AP_Var.h | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Common/AP_Var.cpp b/libraries/AP_Common/AP_Var.cpp index 6b4290ed82..eb365cc50b 100644 --- a/libraries/AP_Common/AP_Var.cpp +++ b/libraries/AP_Common/AP_Var.cpp @@ -522,7 +522,6 @@ bool AP_Var::_EEPROM_locate(bool allocate) // If not located and not permitted to allocate, we have failed. // if (!allocate) { - debug("cannot allocate"); return false; } debug("needs allocation"); diff --git a/libraries/AP_Common/AP_Var.h b/libraries/AP_Common/AP_Var.h index b2f4295c93..df2645426f 100644 --- a/libraries/AP_Common/AP_Var.h +++ b/libraries/AP_Common/AP_Var.h @@ -45,7 +45,7 @@ public: }; static const uint16_t k_EEPROM_magic = 0x5041; ///< "AP" - static const uint16_t k_EEPROM_revision = 1; ///< current format revision + static const uint16_t k_EEPROM_revision = 2; ///< current format revision /// Storage key for variables that are saved in EEPROM. /// @@ -72,15 +72,15 @@ public: /// struct Var_header { /// The size of the variable, minus one. - /// This allows a variable or group to be anything from one to 32 bytes long. + /// This allows a variable or group to be anything from one to 64 bytes long. /// - uint8_t size:5; + uint8_t size:6; /// Spare bits, currently unused /// /// @todo One could be a parity bit? /// - uint8_t spare:3; + uint8_t spare:2; /// The key assigned to the variable. /// @@ -122,7 +122,7 @@ public: /// ::save_all and ::load_all functions. It should match the maximum size that can /// be encoded in the Var_header::size field. /// - static const size_t k_size_max = 32; + static const size_t k_size_max = 64; /// Optional flags affecting the behavior and usage of the variable. ///