This commit is contained in:
e2002
2022-04-18 12:55:32 +03:00
parent 22fe7a36b1
commit 1895043ba4
9 changed files with 38 additions and 22 deletions

View File

@@ -533,27 +533,10 @@ void Display::ip() {
dsp.ip(WiFi.localIP().toString().c_str());
}
void Display::checkConnection() {
if (WiFi.status() != WL_CONNECTED) {
bool playing = player.mode == PLAYING;
swichMode(LOST);
if (playing) player.mode = STOPPED;
WiFi.disconnect();
ip();
WiFi.reconnect();
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
swichMode(PLAYER);
if (playing) player.play(config.store.lastStation);
}
}
void Display::time(bool redraw) {
if (dsp_before_clock) if (!dsp_before_clock(&dsp, dt)) return;
char timeStringBuff[20] = { 0 };
if (!dt) {
checkConnection();
heap();
rssi();
}