From b7d22c21360676f993aed024cb46a05a2605d9cd Mon Sep 17 00:00:00 2001 From: samuelbles07 Date: Fri, 6 Dec 2024 15:19:03 +0700 Subject: [PATCH] Fix SPIFFS usage percentage --- src/AgValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AgValue.cpp b/src/AgValue.cpp index e55f79b..f14edfd 100644 --- a/src/AgValue.cpp +++ b/src/AgValue.cpp @@ -1078,7 +1078,7 @@ bool Measurements::resetLocalStorage() { } bool Measurements::saveLocalStorage(AirGradient &ag) { - int spiffUsed = (SPIFFS.usedBytes() / SPIFFS.totalBytes()) / 2; + int spiffUsed = ((float)SPIFFS.usedBytes() / (float)SPIFFS.totalBytes()) * 100.0; Serial.printf("%d | %d\n", SPIFFS.totalBytes(), SPIFFS.usedBytes()); Serial.printf("SPIFF used %d%%\n", spiffUsed); if (spiffUsed > 98) {