Use a separate sketch to load EEPROM.
This commit is contained in:
parent
fb0afa7e43
commit
2673fa7fa3
@ -14,7 +14,6 @@
|
||||
|
||||
// My Includes
|
||||
#include "config.h"
|
||||
#include "eeprom_init.h"
|
||||
#include "button.h"
|
||||
#include "slowPWM.h"
|
||||
|
||||
@ -74,7 +73,6 @@ LiquidScreen home_screen(KettleState_line, kettle_power_line);
|
||||
LiquidMenu menu(lcd);
|
||||
|
||||
void setup() {
|
||||
StoreEEPROM();
|
||||
|
||||
unsigned long lastRun = millis() - UpdateInterval;
|
||||
Serial.begin(9600);
|
||||
|
@ -1,40 +1,8 @@
|
||||
#include <EEPROM.h>
|
||||
|
||||
const uint8_t CompileTimeP[] PROGMEM = __DATE__ " " __TIME__;
|
||||
const size_t ConfAddress = sizeof(CompileTimeP);
|
||||
|
||||
unsigned char b, e = -1, *p = (uint8_t*)CompileTimeP - 1;
|
||||
|
||||
struct Vessel {
|
||||
char name[16];
|
||||
char setpoint[20];
|
||||
char sensor[20];
|
||||
double Rref;
|
||||
double RNominal;
|
||||
};
|
||||
|
||||
struct Topic {
|
||||
char root[10];
|
||||
Vessel mash;
|
||||
Vessel boil;
|
||||
};
|
||||
|
||||
struct Mqtt {
|
||||
IPAddress broker;
|
||||
char user[10];
|
||||
char password[21];
|
||||
Topic topic;
|
||||
};
|
||||
|
||||
struct ConfigData {
|
||||
Mqtt mqtt;
|
||||
int interval;
|
||||
int period;
|
||||
uint8_t threshold;
|
||||
uint8_t hysteresis;
|
||||
};
|
||||
#include "config.h"
|
||||
|
||||
void StoreEEPROM() {
|
||||
unsigned char b, e = -1, *p = (uint8_t*)CompileTimeP - 1;
|
||||
while( b = pgm_read_byte( ++p ) ){
|
||||
if( b != EEPROM[++e] ){
|
||||
|
Loading…
Reference in New Issue
Block a user