From cf4947d898ce8ba4102dbcd780db91bbaaa1e951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 21 Sep 2022 17:05:10 +0200 Subject: [PATCH] Fix build for non-ESP32 --- src/FSCommon.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/FSCommon.cpp b/src/FSCommon.cpp index ecda025cb..74f6fd4cc 100644 --- a/src/FSCommon.cpp +++ b/src/FSCommon.cpp @@ -56,10 +56,18 @@ void listDir(const char * dirname, uint8_t levels) while(file){ if(file.isDirectory() && !String(file.name()).endsWith(".")) { if(levels){ +#ifdef ARCH_ESP32 listDir(file.path(), levels -1); +#else + listDir(file.name(), levels -1); +#endif } } else { +#ifdef ARCH_ESP32 DEBUG_MSG(" %s (%i Bytes)\n", file.path(), file.size()); +#else + DEBUG_MSG(" %s (%i Bytes)\n", file.name(), file.size()); +#endif } file.close(); file = root.openNextFile(); @@ -116,8 +124,11 @@ void fsInit() DEBUG_MSG("ERROR filesystem mount Failed. Formatting...\n"); assert(0); // FIXME - report failure to phone } - +#ifdef ARCH_ESP32 DEBUG_MSG("Filesystem files (%d/%d total Bytes):\n", FSCom.usedBytes(), FSCom.totalBytes()); +#else + DEBUG_MSG("Filesystem files:\n"); +#endif listDir("/", 10); #endif }