12345678910111213141516171819 |
- #include "Storage.h"
- #include <EEPROM.h>
-
- void Storage::load(AppCoreState& data)
- {
- auto version = EEPROM.read(0);
- if (version == 1)
- {
- data.appState.water.setting = EEPROM.read(1);
- data.appState.heater.setting = EEPROM.read(2);
- }
- }
-
- void Storage::save(const AppCoreState& data)
- {
- EEPROM.write(0, 1);
- EEPROM.write(1, data.appState.water.setting);
- EEPROM.write(2, data.appState.heater.setting);
- }
|