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",
|
"type": "h4",
|
||||||
"title": "Осталось памяти: {{freeBytes}}"
|
"title": "Остаток памяти: {{freeBytes}}"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "h4",
|
|
||||||
"title": "Осталось памяти: {{freePer}} %"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "hr"
|
"type": "hr"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -3,18 +3,32 @@
|
|||||||
|
|
||||||
void getFSInfo() {
|
void getFSInfo() {
|
||||||
// Информация о ФС
|
// Информация о ФС
|
||||||
//size_t totalBytes; // всего
|
|
||||||
//size_t usedBytes; // использовано
|
|
||||||
//size_t maxOpenFiles; // лимит на открые файлы
|
|
||||||
//size_t maxPathLength; // лимит на полное пути + имя файла
|
|
||||||
|
|
||||||
FSInfo buf;
|
FSInfo buf;
|
||||||
getInfo(buf);
|
if (getInfo(buf)) {
|
||||||
size_t freeBytes = buf.totalBytes - buf.usedBytes;
|
SerialPrint("I", F("FS"), F("Get FS info completed"));
|
||||||
float freePer = buf.usedBytes / buf.totalBytes * 100;
|
|
||||||
|
|
||||||
jsonWriteInt(configSetupJson, F("freeBytes"), freeBytes);
|
size_t totalBytes = buf.totalBytes; // всего
|
||||||
jsonWriteFloat(configSetupJson, F("freePer"), freePer);
|
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) {
|
bool getInfo(FSInfo& info) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ bool fileSystemInit() {
|
|||||||
SerialPrint("E", F("FS"), F("FS Init ERROR, may be FS was not flashed"));
|
SerialPrint("E", F("FS"), F("FS Init ERROR, may be FS was not flashed"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SerialPrint("I", F("FS"), F("FS Init"));
|
SerialPrint("I", F("FS"), F("FS Init completed"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user