mirror of https://github.com/ArduPilot/ardupilot
Fixed EEProm set bug.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1243 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
f8f9575c3d
commit
bc7068b4df
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue