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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user