Skip to content
Snippets Groups Projects
Commit 0344d54d authored by james.goppert's avatar james.goppert
Browse files

Fixed EEProm set bug.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1243 f9c3cf11-9bcb-44bc-f272-b75c42450872
parent 8e34d41c
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,8 @@ public: ...@@ -65,8 +65,8 @@ public:
eepromRegistry.add(this,_id,_address,sizeof(_data)); eepromRegistry.add(this,_id,_address,sizeof(_data));
} }
void set(type val) { void set(type val) {
if (_sync) save();
_data = val; _data = val;
if (_sync) save();
} }
type get() { type get() {
if (_sync) load(); if (_sync) load();
......
...@@ -72,8 +72,8 @@ void loop() ...@@ -72,8 +72,8 @@ void loop()
Serial.printf_P(PSTR("\neepromRegistry(id)->getEntry(): %f\n"), eepromRegistry(id)->getEntry()); Serial.printf_P(PSTR("\neepromRegistry(id)->getEntry(): %f\n"), eepromRegistry(id)->getEntry());
delay(2000); delay(2000);
eepromRegistry(id)->setEntry(456); eepromRegistry(id)->setEntry(4.56);
Serial.printf_P(PSTR("\neepromRegistry(id)->setEntry(456): %d\n"), var2.get()); Serial.printf_P(PSTR("\neepromRegistry(id)->setEntry(4.56): %f\n"), var2.get());
delay(2000); delay(2000);
Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry(id)->getName()); Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry(id)->getName());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment