Select a file by default

This commit is contained in:
Gabriel Augendre 2023-01-01 18:14:05 +01:00
parent 8628357404
commit fa4bb53060

View file

@ -71,6 +71,21 @@ void setup()
return; return;
} }
File root = SPIFFS.open("/music");
File file = root.openNextFile();
while (file)
{
String fileName = file.name();
if (!fileName.startsWith("."))
{
selectedFile = fileName;
Serial.println("Selected " + fileName);
break;
}
file.close();
file = root.openNextFile();
}
// Wifi // Wifi
#ifdef B_WIFI_AP #ifdef B_WIFI_AP
Serial.println("Setting up AP..."); Serial.println("Setting up AP...");