Make (almost) all EEPROM settings read be bounded, and rewritten if "out of bounds"

This commit is contained in:
John Stäck 2019-07-25 11:58:09 +02:00
parent c8e96343d0
commit 25d22fc42f
2 changed files with 80 additions and 74 deletions

View file

@ -121,9 +121,11 @@
#define DAC_MODE_FACTORY DAC_MODE_BREATH
bool readEEPROM();
void readEEPROM();
void setBit(uint16_t &bitfield, const uint8_t pos, const uint16_t value);
uint16_t readSetting(uint16_t address);
void writeSetting(uint16_t address, uint16_t value);
uint16_t readSettingBounded(uint16_t address, uint16_t min, uint16_t max, uint16_t defaultValue);
#endif