diff --git a/src/hasp/hasp_dispatch.cpp b/src/hasp/hasp_dispatch.cpp index d812d877..8670ce4a 100644 --- a/src/hasp/hasp_dispatch.cpp +++ b/src/hasp/hasp_dispatch.cpp @@ -1082,8 +1082,10 @@ void dispatchSetup() dispatch_add_command(PSTR("discovery"), dispatch_send_discovery); dispatch_add_command(PSTR("factoryreset"), dispatch_factory_reset); #if HASP_USE_SPIFFS > 0 || HASP_USE_LITTLEFS > 0 +#if defined(ARDUINO_ARCH_ESP32) dispatch_add_command(PSTR("unzip"), filesystemUnzip); #endif +#endif #if HASP_USE_CONFIG > 0 dispatch_add_command(PSTR("setupap"), oobeFakeSetup); #endif diff --git a/src/hasp_filesystem.cpp b/src/hasp_filesystem.cpp index c7b20fe0..eb9c2805 100644 --- a/src/hasp_filesystem.cpp +++ b/src/hasp_filesystem.cpp @@ -11,21 +11,10 @@ #include "hasp_debug.h" #include "hasp_filesystem.h" + +#if defined(ARDUINO_ARCH_ESP32) #include "rom/crc.h" -void filesystemInfo() -{ // Get all information of your SPIFFS -#ifdef ESP8266 - FSInfo fs_info; - HASP_FS.info(fs_info); - Log.verbose(TAG_FILE, "Partition size: total: %d, used: %d", fs_info.totalBytes, fs_info.usedBytes); -#endif - -#ifdef ESP32 - Log.verbose(TAG_FILE, "Partition size: total: %d, used: %d", HASP_FS.totalBytes(), HASP_FS.usedBytes()); -#endif -} - void filesystemUnzip(const char*, const char* filename) { File zipfile = HASP_FS.open(filename, FILE_READ); @@ -137,6 +126,20 @@ void filesystemUnzip(const char*, const char* filename) zipfile.close(); LOG_VERBOSE(TAG_FILE, F("extracting %s complete"), filename); } +#endif + +void filesystemInfo() +{ // Get all information of your SPIFFS +#ifdef ESP8266 + FSInfo fs_info; + HASP_FS.info(fs_info); + Log.verbose(TAG_FILE, "Partition size: total: %d, used: %d", fs_info.totalBytes, fs_info.usedBytes); +#endif + +#ifdef ESP32 + Log.verbose(TAG_FILE, "Partition size: total: %d, used: %d", HASP_FS.totalBytes(), HASP_FS.usedBytes()); +#endif +} void filesystemList() { diff --git a/src/hasp_filesystem.h b/src/hasp_filesystem.h index 62f7da60..07fd1f8b 100644 --- a/src/hasp_filesystem.h +++ b/src/hasp_filesystem.h @@ -10,7 +10,10 @@ bool filesystemSetup(void); void filesystemList(); void filesystemInfo(); + +#if defined(ARDUINO_ARCH_ESP32) void filesystemUnzip(const char*, const char* filename); +#endif enum { ZIP_NO_COMPRESSION = 0, ZIP_DEFLTATE = 8 }; typedef uint16_t zip_compression_method_t;