Browse Source

Fixed EEProm for new vector style.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1252 f9c3cf11-9bcb-44bc-f272-b75c42450872
mission-4.1.18
james.goppert 14 years ago
parent
commit
8bd5cd041e
  1. 2
      libraries/AP_EEProm/AP_EEProm.cpp
  2. 2
      libraries/AP_EEProm/AP_EEProm.h
  3. 16
      libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde

2
libraries/AP_EEProm/AP_EEProm.cpp

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* AP_EEProm.h
* AP_EEProm.cpp
* Copyright (C) James Goppert 2010 <james.goppert@gmail.com>
*
* This file is free software: you can redistribute it and/or modify it

2
libraries/AP_EEProm/AP_EEProm.h

@ -85,7 +85,7 @@ protected: @@ -85,7 +85,7 @@ protected:
/**
* The main EEProm Registry class.
*/
class AP_EEPromRegistry : public AP_Vector<AP_EEPromEntry *>
class AP_EEPromRegistry : public Vector<AP_EEPromEntry *>
{
public:

16
libraries/AP_EEProm/examples/AP_EEProm/AP_EEProm.pde

@ -38,15 +38,15 @@ void loop() @@ -38,15 +38,15 @@ void loop()
Serial.printf_P(PSTR("\nvar.getId(): %d\n"), id);
delay(2000);
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);
eepromRegistry(id)->setEntry(456);
eepromRegistry[id]->setEntry(456);
Serial.printf_P(PSTR("\neepromRegistry(id)->setEntry(456): %d\n"), var.get());
delay(2000);
Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry(id)->getName());
Serial.printf_P(PSTR("\nprint the parameters address by id: %d\n"), int(eepromRegistry(id)->getAddress()));
Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry[id]->getName());
Serial.printf_P(PSTR("\nprint the parameters address by id: %d\n"), int(eepromRegistry[id]->getAddress()));
Serial.print("\n\nSynced variable demo\n");
@ -69,15 +69,15 @@ void loop() @@ -69,15 +69,15 @@ void loop()
Serial.printf_P(PSTR("\nvar2.getId(): %d\n"), id);
delay(2000);
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);
eepromRegistry(id)->setEntry(4.56);
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());
Serial.printf_P(PSTR("\nprint the parameters address by id: %d\n"), int(eepromRegistry(id)->getAddress()));
Serial.printf_P(PSTR("\nprint the parameters name by id: %s\n"), eepromRegistry[id]->getName());
Serial.printf_P(PSTR("\nprint the parameters address by id: %d\n"), int(eepromRegistry[id]->getAddress()));
delay(5000);
}

Loading…
Cancel
Save