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

@ -8,6 +8,16 @@
#ifndef CONFIG_H_
#define CONFIG_H_
#include "cmd.h"
class ConfigInvalidateCmd : public Cmd {
public:
virtual String getCmdName() { return "CFGINV"; }
virtual String getHelp() { return "Invalidate the stored configuration"; }
virtual String exec(String params);
};
typedef union {
@ -25,6 +35,11 @@ typedef union {
uint8_t e[sizeof(unsigned long)];
} u_ulong;
typedef union {
bool b;
uint8_t e[sizeof(bool)];
} u_bool;
namespace Config {
const unsigned int MAGIC_TOKEN = 0xDEADBEEF;
@ -33,7 +48,11 @@ namespace Config {
const int THERMOMETER_ALPHA = 4; // 4
const int THERMOMETER_PERIOD = 8; // 8
const int THERMOMETER_CAL[4] = {12, 16, 20, 24}; // 4 x 4
const int THERMOMETER_DEBUG = 28; // 1
const int THERMOMETER_INFO = 29; // 1
bool getBool(int pos);
void setBool(int pos, bool value);
float getFloat(int pos);
void setFloat(int pos, float value);
unsigned int getUInt(int pos);