This commit is contained in:
Alex
2019-06-10 18:33:59 +03:00
parent 6e25ac7d47
commit 53b74e6db4
9 changed files with 927 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
void saveEEPROM() {
EEPROM.put(3 * currentMode, modes[currentMode]);
EEPROM.commit();
}
void eepromTick() {
if (settChanged && millis() - eepromTimer > 30000) {
settChanged = false;
eepromTimer = millis();
saveEEPROM();
if (EEPROM.read(100) != currentMode) EEPROM.write(501, currentMode);
EEPROM.commit();
}
}
void saveAlarm(byte almNumber) {
EEPROM.write(5 * almNumber + 50, alarm[almNumber].state); // рассвет
eeWriteInt(5 * almNumber + 50 + 1, alarm[almNumber].time);
EEPROM.commit();
}
void saveDawnMmode() {
EEPROM.write(100, dawnMode); // рассвет
EEPROM.commit();
}