mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
fixed
This commit is contained in:
Binary file not shown.
@@ -51,11 +51,7 @@
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Осталось памяти: {{freeBytes}}"
|
||||
},
|
||||
{
|
||||
"type": "h4",
|
||||
"title": "Осталось памяти: {{freePer}} %"
|
||||
"title": "Остаток памяти: {{freeBytes}}"
|
||||
},
|
||||
{
|
||||
"type": "hr"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user