slightly reduce flickering during file access

it seems that reading/writing "larger" files from LittleFS causes LED flickering.

This change adds a simple cache for "file not found" results, so that repeated file.exists() calls are avoided.
This commit is contained in:
Frank
2024-04-28 18:57:05 +02:00
parent 3567243d18
commit d058e33df3
4 changed files with 34 additions and 1 deletions

View File

@@ -58,6 +58,7 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
request->_tempFile.close();
USER_PRINT(F("File uploaded: ")); // WLEDMM
USER_PRINTLN(filename); // WLEDMM
invalidateFileNameCache(); // WLEDMM
if (filename.equalsIgnoreCase("/cfg.json") || filename.equalsIgnoreCase("cfg.json")) { // WLEDMM
request->send(200, "text/plain", F("Configuration restore successful.\nRebooting..."));
doReboot = true;