From 70e4b64225091764ea8b42bfc0b76dc0ae0dcac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20F=2E=20Aasen?= Date: Fri, 24 Feb 2023 19:06:33 +0100 Subject: [PATCH] Flush data to flash on ESP8266 and ESP32 When we write logs, we need to flush the data to flash, so we don't lose it. This was not possible on ESP8266 because of definitions to only allow ESP32 access to these functions. This restriction is now removed. --- src/BrewLogger.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/BrewLogger.cpp b/src/BrewLogger.cpp index 2adb818b7..02a8e45e7 100644 --- a/src/BrewLogger.cpp +++ b/src/BrewLogger.cpp @@ -384,11 +384,9 @@ BrewLogger::BrewLogger(void){ if(wlen != _logIndex){ DBG_PRINTF("!!!write failed @ %d\n",_logIndex); } - #if ESP32 #if UseLittleFS _logFile.flush(); #endif - #endif } } @@ -1082,12 +1080,9 @@ BrewLogger::BrewLogger(void){ if(wlen != _logIndex){ DBG_PRINTF("!!!write failed @ %d\n",_logIndex); } - #if ESP32 #if UseLittleFS _logFile.flush(); #endif - - #endif } _savedLength += _logIndex; @@ -1137,13 +1132,10 @@ BrewLogger::BrewLogger(void){ int nlen = len + idx -LogBufferSize; wlen += _logFile.write((const uint8_t*)buf,nlen); } - #if ESP32 #if UseLittleFS _logFile.flush(); #endif - #endif } - } void BrewLogger::_addGravityRecord(bool isOg, uint16_t gravity){