esphub/esphub/debug.ino
2024-11-22 22:31:11 +00:00

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();
}
}