From 028005a8d711039140a07ce7a6ce00f7cbf02bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 20 Aug 2017 01:32:35 +0200 Subject: [PATCH] More info about SPIFFS 'partition' on boot log --- code/espurna/espurna.ino | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/code/espurna/espurna.ino b/code/espurna/espurna.ino index fd8ee64d..f08548d5 100644 --- a/code/espurna/espurna.ino +++ b/code/espurna/espurna.ino @@ -176,9 +176,30 @@ void welcome() { DEBUG_MSG_P(PSTR("Flash size (CHIP): %8u bytes / %4d sectors\n"), ESP.getFlashChipRealSize(), sectors(ESP.getFlashChipRealSize())); DEBUG_MSG_P(PSTR("Firmware size: %8u bytes / %4d sectors\n"), ESP.getSketchSize(), sectors(ESP.getSketchSize())); DEBUG_MSG_P(PSTR("OTA size: %8u bytes / %4d sectors\n"), ESP.getFreeSketchSpace(), sectors(ESP.getFreeSketchSpace())); + #if ENABLE_SPIFFS + FSInfo fs_info; + bool fs = SPIFFS.info(fs_info); + if (fs) { + DEBUG_MSG_P(PSTR("SPIFFS size: %8u bytes / %4d sectors\n"), fs_info.totalBytes, sectors(fs_info.totalBytes)); + } + #else + DEBUG_MSG_P(PSTR("SPIFFS size: %8u bytes / %4d sectors\n"), 0, 0); + #endif DEBUG_MSG_P(PSTR("EEPROM size: %8u bytes / %4d sectors\n"), settingsMaxSize(), sectors(settingsMaxSize())); DEBUG_MSG_P(PSTR("Empty space: %8u bytes / 4 sectors\n"), 4 * SPI_FLASH_SEC_SIZE); + #if ENABLE_SPIFFS + if (fs) { + DEBUG_MSG_P(PSTR("\n")); + DEBUG_MSG_P(PSTR("SPIFFS total size: %8u bytes\n"), fs_info.totalBytes); + DEBUG_MSG_P(PSTR(" used size: %8u bytes\n"), fs_info.usedBytes); + DEBUG_MSG_P(PSTR(" block size: %8u bytes\n"), fs_info.blockSize); + DEBUG_MSG_P(PSTR(" page size: %8u bytes\n"), fs_info.pageSize); + DEBUG_MSG_P(PSTR(" max files: %8u\n"), fs_info.maxOpenFiles); + DEBUG_MSG_P(PSTR(" max length: %8u\n"), fs_info.maxPathLength); + } + #endif + DEBUG_MSG_P(PSTR("\n")); unsigned char custom_reset = customReset(); if (custom_reset > 0) { @@ -190,19 +211,6 @@ void welcome() { } DEBUG_MSG_P(PSTR("Free heap: %u bytes\n"), ESP.getFreeHeap()); - #if ENABLE_SPIFFS - FSInfo fs_info; - if (SPIFFS.info(fs_info)) { - DEBUG_MSG_P(PSTR("\n")); - DEBUG_MSG_P(PSTR("File system total size: %d bytes\n"), fs_info.totalBytes); - DEBUG_MSG_P(PSTR(" used size : %d bytes\n"), fs_info.usedBytes); - DEBUG_MSG_P(PSTR(" block size: %d bytes\n"), fs_info.blockSize); - DEBUG_MSG_P(PSTR(" page size : %d bytes\n"), fs_info.pageSize); - DEBUG_MSG_P(PSTR(" max files : %d\n"), fs_info.maxOpenFiles); - DEBUG_MSG_P(PSTR(" max length: %d\n"), fs_info.maxPathLength); - } - #endif - DEBUG_MSG_P(PSTR("\n\n")); }