Skip to content

Commit

Permalink
Fix SPIFFS usage percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbles07 committed Dec 6, 2024
1 parent 6cd5e9f commit b7d22c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AgValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b7d22c2

Please sign in to comment.