Use a separate sketch to load EEPROM.

This commit is contained in:
Chris Giacofei 2022-01-20 09:53:25 -05:00
parent fb0afa7e43
commit 2673fa7fa3
2 changed files with 2 additions and 36 deletions

View File

@ -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);

View File

@ -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] ){