diff --git a/esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp b/esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp index 4e449399..815969e8 100644 --- a/esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp +++ b/esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp @@ -154,6 +154,9 @@ uint64_t ESP_SD::totalBytes() uint64_t ESP_SD::usedBytes() { + if(freeBytes() >totalBytes() ) { + _sizechanged = true; + } return totalBytes() - freeBytes(); } diff --git a/esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp b/esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp index a38d16c5..b663ed1d 100644 --- a/esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp +++ b/esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp @@ -144,6 +144,9 @@ uint64_t ESP_SD::totalBytes() uint64_t ESP_SD::usedBytes() { + if(freeBytes() >totalBytes() ) { + _sizechanged = true; + } return totalBytes() - freeBytes(); }