Skip to content

Commit

Permalink
Fix low FPS if not connected to wi-fi & internet.
Browse files Browse the repository at this point in the history
Only update timeClient if connected.
  • Loading branch information
jasoncoon committed Apr 8, 2021
1 parent bf42538 commit 38b7d18
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esp8266-fastled-webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@ void loop() {
webServer.handleClient();
MDNS.update();

timeClient.update();

static bool hasConnected = false;
EVERY_N_SECONDS(1) {
if (WiFi.status() != WL_CONNECTED) {
Expand All @@ -604,6 +602,9 @@ void loop() {
Serial.print(nameString);
Serial.println(".local in your browser");
}
else {
timeClient.update();
}
}

checkPingTimer();
Expand Down Expand Up @@ -897,7 +898,7 @@ void readSettings()
{
// check for "magic number" so we know settings have been written to EEPROM
// and it's not just full of random bytes

if (EEPROM.read(511) != 55) {
return;
}
Expand Down

0 comments on commit 38b7d18

Please sign in to comment.