From e3545c8a5e1575a09a47c1a7f5a2a3e7f944a646 Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Thu, 10 Dec 2020 18:16:01 +0100 Subject: [PATCH] Add refresh if data is not consistent --- esp3d/src/modules/filesystem/sd/sd_native_esp8266.cpp | 3 +++ esp3d/src/modules/filesystem/sd/sd_sdfat_esp32.cpp | 3 +++ 2 files changed, 6 insertions(+) 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(); }