read LittleFS.totalBytes only once on start

This commit is contained in:
MichaelDvP
2022-09-17 17:10:23 +02:00
parent 872effb297
commit 0d5d353e99
3 changed files with 10 additions and 2 deletions

View File

@@ -373,6 +373,7 @@ void System::start() {
if (low_clock_) {
setCpuFrequencyMhz(160);
}
fstotal_ = LittleFS.totalBytes(); // read only once, it takes 500 ms to read
#endif
EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) {
@@ -784,7 +785,7 @@ void System::show_system(uuid::console::Shell & shell) {
shell.printfln(F(" SDK version: %s"), ESP.getSdkVersion());
shell.printfln(F(" CPU frequency: %lu MHz"), ESP.getCpuFreqMHz());
shell.printfln(F(" Free heap: %lu bytes"), (uint32_t)ESP.getFreeHeap());
shell.printfln(F(" FS used/total: %lu/%lu (bytes)"), LittleFS.usedBytes(), LittleFS.totalBytes());
shell.printfln(F(" FS used/total: %lu/%lu (bytes)"), LittleFS.usedBytes(), FStotal());
shell.println();
shell.println("Network:");