From 11faf9a948573f11d057fe5d5bf20ffdc322689b Mon Sep 17 00:00:00 2001 From: Florian Date: Thu, 23 Mar 2023 14:11:19 -0500 Subject: [PATCH] [SSD1306] Give some time for the flash to start (#1571) Before reading the preferences, the goal is to avoid getting stuck during preferences reading operations --- main/ZdisplaySSD1306.ino | 1 + main/main.ino | 1 + 2 files changed, 2 insertions(+) diff --git a/main/ZdisplaySSD1306.ino b/main/ZdisplaySSD1306.ino index 775597c..400ed6a 100644 --- a/main/ZdisplaySSD1306.ino +++ b/main/ZdisplaySSD1306.ino @@ -175,6 +175,7 @@ void MQTTtoSSD1306(char* topicOri, JsonObject& SSD1306data) { // json object dec // save, load, init, erase if (SSD1306data.containsKey("save") && SSD1306data["save"]) { SSD1306Config_save(); + success = true; } else if (SSD1306data.containsKey("load") && SSD1306data["load"]) { success = SSD1306Config_load(); if (success) { diff --git a/main/main.ino b/main/main.ino index 859385c..4125e43 100644 --- a/main/main.ino +++ b/main/main.ino @@ -761,6 +761,7 @@ void setup() { SetupIndicators(); // For RGB Leds #if defined(ESP8266) || defined(ESP32) + delay(100); //give time to start the flash and avoid issue when reading the preferences # ifdef ESP8266 # ifndef ZgatewaySRFB // if we are not in sonoff rf bridge case we apply the ESP8266 GPIO optimization Serial.end();