25 lines
556 B
C++
25 lines
556 B
C++
// Helper function for logging errors in debug mode
|
|
void logError(const char* message) {
|
|
#ifdef DEBUG_MODE
|
|
Serial.println(message);
|
|
Serial.flush();
|
|
#endif
|
|
}
|
|
|
|
// List files in LittleFS
|
|
void listFiles() {
|
|
Serial.println("Listing files in LittleFS:");
|
|
|
|
File root = LittleFS.open("/"); // Use LittleFS instead of SPIFFS
|
|
if (!root) {
|
|
Serial.println("Failed to open filesystem");
|
|
return;
|
|
}
|
|
|
|
File file = root.openNextFile();
|
|
while (file) {
|
|
Serial.print("File: ");
|
|
Serial.println(file.name());
|
|
file = root.openNextFile();
|
|
}
|
|
} |