1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Refactoring of FS::info (#779)

This commit is contained in:
Ivan Grokhotkov
2015-11-13 13:23:16 +03:00
parent d7e340fe14
commit d0a944e417
6 changed files with 64 additions and 9 deletions

View File

@ -71,11 +71,15 @@ public:
}
return true;
}
bool info(uint32_t *total, uint32_t *used) override{
auto rc = SPIFFS_info(&_fs, total, used);
if (rc != SPIFFS_OK) {
DEBUGV("SPIFFS_format: rc=%d, err=%d\r\n", rc, _fs.err_code);
bool info(FSInfo& info) override {
info.maxOpenFiles = _maxOpenFds;
info.blockSize = _blockSize;
info.pageSize = _pageSize;
info.maxOpenFiles = _maxOpenFds;
info.maxPathLength = SPIFFS_OBJ_NAME_LEN;
auto rc = SPIFFS_info(&_fs, &info.totalBytes, &info.usedBytes);
if (rc != SPIFFS_OK) {
DEBUGV("SPIFFS_info: rc=%d, err=%d\r\n", rc, _fs.err_code);
return false;
}
return true;