From bc7068b4df6e0f9abc5e330b6811d7a77deb034c Mon Sep 17 00:00:00 2001 From: "james.goppert" Date: Fri, 24 Dec 2010 04:25:40 +0000 Subject: [PATCH] Fixed EEProm set bug. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1243 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_EEProm/AP_EEProm.h | 2 +- libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_EEProm/AP_EEProm.h b/libraries/AP_EEProm/AP_EEProm.h index afd70c6ca5..02f260b61f 100644 --- a/libraries/AP_EEProm/AP_EEProm.h +++ b/libraries/AP_EEProm/AP_EEProm.h @@ -65,8 +65,8 @@ public: eepromRegistry.add(this,_id,_address,sizeof(_data)); } void set(type val) { - if (_sync) save(); _data = val; + if (_sync) save(); } type get() { if (_sync) load(); diff --git a/libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde b/libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde index 6be26c968a..3a807d8955 100644 --- a/libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde +++ b/libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde @@ -72,8 +72,8 @@ void loop() Serial.printf_P(PSTR("\neepromRegistry(id)->getEntry(): %f\n"), eepromRegistry(id)->getEntry()); delay(2000); - eepromRegistry(id)->setEntry(456); - Serial.printf_P(PSTR("\neepromRegistry(id)->setEntry(456): %d\n"), var2.get()); + eepromRegistry(id)->setEntry(4.56); + Serial.printf_P(PSTR("\neepromRegistry(id)->setEntry(4.56): %f\n"), var2.get()); delay(2000); Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry(id)->getName());