store debug and info in eeprom too

This commit is contained in:
hg
2014-03-04 19:08:19 +01:00
parent 61b90393dc
commit f2162af9c6
5 changed files with 100 additions and 27 deletions

View File

@ -10,6 +10,30 @@
#include "Config.h"
String ConfigInvalidateCmd::exec(String params) {
Config::setUInt(Config::MAGIC, 0);
return "done";
}
bool Config::getBool(int pos) {
u_bool u;
for (unsigned int i = 0; i < sizeof(bool); i++) {
u.e[i] = EEPROM.read(pos + i);
}
return u.b;
}
void Config::setBool(int pos, bool value) {
u_bool u;
u.b = value;
for (unsigned int i = 0; i < sizeof(bool); i++) {
EEPROM.write(pos + i, u.e[i]);
}
}
float Config::getFloat(int pos) {
u_float u;
for (unsigned int i = 0; i < sizeof(float); i++) {