last_station

This commit is contained in:
e2002
2022-12-27 13:03:47 +03:00
parent fa2d1a33c9
commit bc10a6c0de
3 changed files with 9 additions and 0 deletions

View File

@@ -23,6 +23,8 @@ void Config::init() {
#endif
eepromRead(EEPROM_START, store);
if (store.config_set != 4262) setDefaults();
backupLastStation = store.lastStation;
Serial.print("Config::init, backupLastStation=\t"); Serial.println(backupLastStation);
if(store.play_mode==80) store.play_mode=PM_WEB;
//if (!SPIFFS.begin(false, "/spiffs", 30)) {
@@ -188,7 +190,11 @@ uint16_t Config::getTimezoneOffset() {
}
void Config::save() {
uint16_t ls = store.lastStation;
if(store.play_mode==PM_SDCARD) store.lastStation = backupLastStation;
if(store.play_mode==PM_WEB) backupLastStation = store.lastStation;
eepromWrite(EEPROM_START, store);
store.lastStation = ls;
}
#if IR_PIN!=255