bugfix: update Flash Usage after file upload
if we have the flicker-free RMT driver, also update FS usage info when filling /json/state
This commit is contained in:
@@ -1078,6 +1078,9 @@ void serializeInfo(JsonObject root)
|
||||
wifi_info[F("channel")] = WiFi.channel();
|
||||
wifi_info[F("ap")] = apActive;
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32) && !defined(WLEDMM_FILEWAIT)
|
||||
updateFSInfo(); // refresh flash usage info - may cause flicker unless we have the RMTHI driver
|
||||
#endif
|
||||
JsonObject fs_info = root.createNestedObject("fs");
|
||||
fs_info["u"] = fsBytesUsed / 1000;
|
||||
fs_info["t"] = fsBytesTotal / 1000;
|
||||
|
||||
@@ -126,6 +126,7 @@ void handleUpload(AsyncWebServerRequest *request, const String& filename, size_t
|
||||
request->send(200, "text/plain", F("File Uploaded!"));
|
||||
}
|
||||
cacheInvalidate++;
|
||||
updateFSInfo(); // refresh memory usage info
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user