diff --git a/data/set.device.json.gz b/data/set.device.json.gz index cf2a1077..ab29128a 100644 Binary files a/data/set.device.json.gz and b/data/set.device.json.gz differ diff --git a/data_ungzip/set.device.json b/data_ungzip/set.device.json index a6d32d35..fcba5100 100644 --- a/data_ungzip/set.device.json +++ b/data_ungzip/set.device.json @@ -51,11 +51,7 @@ }, { "type": "h4", - "title": "Осталось памяти: {{freeBytes}}" - }, - { - "type": "h4", - "title": "Осталось памяти: {{freePer}} %" + "title": "Остаток памяти: {{freeBytes}}" }, { "type": "hr" diff --git a/data_ungzip/set.device.json.gz b/data_ungzip/set.device.json.gz index cf2a1077..ab29128a 100644 Binary files a/data_ungzip/set.device.json.gz and b/data_ungzip/set.device.json.gz differ diff --git a/doc/calculator.xlsx b/doc/calculator.xlsx index 4009f34f..dc077bcd 100644 Binary files a/doc/calculator.xlsx and b/doc/calculator.xlsx differ diff --git a/src/FileSystem.cpp b/src/FileSystem.cpp index 2345f088..c4559685 100644 --- a/src/FileSystem.cpp +++ b/src/FileSystem.cpp @@ -3,18 +3,32 @@ void getFSInfo() { // Информация о ФС - //size_t totalBytes; // всего - //size_t usedBytes; // использовано - //size_t maxOpenFiles; // лимит на открые файлы - //size_t maxPathLength; // лимит на полное пути + имя файла + FSInfo buf; - getInfo(buf); - size_t freeBytes = buf.totalBytes - buf.usedBytes; - float freePer = buf.usedBytes / buf.totalBytes * 100; + if (getInfo(buf)) { + SerialPrint("I", F("FS"), F("Get FS info completed")); - jsonWriteInt(configSetupJson, F("freeBytes"), freeBytes); - jsonWriteFloat(configSetupJson, F("freePer"), freePer); + size_t totalBytes = buf.totalBytes; // всего + size_t usedBytes = buf.usedBytes; // использовано + size_t maxOpenFiles = buf.maxOpenFiles; // лимит на открые файлы + size_t maxPathLength = buf.maxPathLength; // лимит на пути и имена файлов + + size_t freeBytes = totalBytes - usedBytes; + float freePer = freeBytes * 100 / totalBytes; + + jsonWriteStr(configSetupJson, F("freeBytes"), String(freePer) + "% (" + String(freeBytes) + ")"); + + SerialPrint("I", F("FS"), "totalBytes=" + String(totalBytes)); + SerialPrint("I", F("FS"), "usedBytes=" + String(usedBytes)); + SerialPrint("I", F("FS"), "maxOpenFiles=" + String(maxOpenFiles)); + SerialPrint("I", F("FS"), "maxPathLength=" + String(maxPathLength)); + SerialPrint("I", F("FS"), "freeBytes=" + String(freeBytes)); + SerialPrint("I", F("FS"), "freePer=" + String(freePer)); + } + else { + SerialPrint("E", F("FS"), F("FS info error")); + } } bool getInfo(FSInfo& info) { diff --git a/src/Utils/FileUtils.cpp b/src/Utils/FileUtils.cpp index 70955088..31927eed 100644 --- a/src/Utils/FileUtils.cpp +++ b/src/Utils/FileUtils.cpp @@ -13,7 +13,7 @@ bool fileSystemInit() { SerialPrint("E", F("FS"), F("FS Init ERROR, may be FS was not flashed")); return false; } - SerialPrint("I", F("FS"), F("FS Init")); + SerialPrint("I", F("FS"), F("FS Init completed")); return true; }