Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
EEPROMConfig.cpp
Go to the documentation of this file.
1#include <EEPROMex.h>
2
3#include "EEPROMConfig.h"
4
6 EEPROM.readBlock(address, configStore);
7
8 // Check whether loaded data is valid and if overrideEEPROM is not set
10 // Set loadedFromEEPROM flag
12 return true;
13 } else {
14 // Reset to defaults
15 reset();
16 save();
17 return false;
18 }
19}
20
21uint16_t EEPROMConfig::save() const {
22 return EEPROM.updateBlock(address, configStore);
23}
24
28
struct ConfigStore defaultConfigStore
uint8_t address
void reset()
Reset the config store: overwrite the configStore with the default values.
uint16_t save() const
Saves current content of configStore into EEPROM.
bool load()
Load config values from EEPROM into configStore.
ConfigStore configStore
EEPROMConfig()
Constructor.
const bool overrideEEPROM
Set to true to override the values stored in EEPROM and use the default PID parameters defined below.
Definition config.h:36
char version[5]
String identifying this block.
Definition EEPROMConfig.h:8
bool loadedFromEEPROM
Whether this has been loaded from EEPROM.
Definition EEPROMConfig.h:9