Use HASP_FS over SPIFFS

This commit is contained in:
fvanroie 2021-05-10 06:36:54 +02:00
parent ff59b55427
commit 0f60213557

View File

@ -16,7 +16,7 @@ void filesystemInfo()
{ // Get all information of your SPIFFS { // Get all information of your SPIFFS
#if 0 #if 0
FSInfo fs_info; FSInfo fs_info;
SPIFFS.info(fs_info); HASP_FS.info(fs_info);
Serial.println("File system info."); Serial.println("File system info.");
@ -71,9 +71,9 @@ void filesystemList()
{ {
#if HASP_USE_SPIFFS > 0 #if HASP_USE_SPIFFS > 0
#if defined(ARDUINO_ARCH_ESP8266) #if defined(ARDUINO_ARCH_ESP8266)
if(!SPIFFS.begin()) { if(!HASP_FS.begin()) {
#else #else
if(!SPIFFS.begin(true)) { if(!HASP_FS.begin(true)) { // default vfs path: /littlefs
#endif #endif
LOG_ERROR(TAG_FILE, F("Flash file system not mouted.")); LOG_ERROR(TAG_FILE, F("Flash file system not mouted."));
} else { } else {
@ -81,7 +81,7 @@ void filesystemList()
LOG_VERBOSE(TAG_FILE, F("Listing files on the internal flash:")); LOG_VERBOSE(TAG_FILE, F("Listing files on the internal flash:"));
#if defined(ARDUINO_ARCH_ESP32) #if defined(ARDUINO_ARCH_ESP32)
File root = SPIFFS.open("/"); File root = HASP_FS.open("/");
File file = root.openNextFile(); File file = root.openNextFile();
while(file) { while(file) {
LOG_VERBOSE(TAG_FILE, F(" * %s (%u bytes)"), file.name(), (uint32_t)file.size()); LOG_VERBOSE(TAG_FILE, F(" * %s (%u bytes)"), file.name(), (uint32_t)file.size());
@ -89,7 +89,7 @@ void filesystemList()
} }
#endif #endif
#if defined(ARDUINO_ARCH_ESP8266) #if defined(ARDUINO_ARCH_ESP8266)
Dir dir = SPIFFS.openDir("/"); Dir dir = HASP_FS.openDir("/");
while(dir.next()) { while(dir.next()) {
LOG_VERBOSE(TAG_FILE, F(" * %s (%u bytes)"), dir.fileName().c_str(), (uint32_t)dir.fileSize()); LOG_VERBOSE(TAG_FILE, F(" * %s (%u bytes)"), dir.fileName().c_str(), (uint32_t)dir.fileSize());
} }