Skip to content

Commit

Permalink
Flush data to flash on ESP8266 and ESP32
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
havardAasen committed Feb 24, 2023
1 parent fad36dc commit 70e4b64
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/BrewLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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){
Expand Down

0 comments on commit 70e4b64

Please sign in to comment.