mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Use HASP_FS over SPIFFS
This commit is contained in:
parent
ff59b55427
commit
0f60213557
@ -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());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user