From 418499aff8752722e14ecb57fa532038649c2d67 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 1 Jan 2023 03:02:57 +0100 Subject: [PATCH] Cleanup setup --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7e21d0c..32ba5bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,16 +80,15 @@ void setup() // List existing files File root = SPIFFS.open("/music"); File file = root.openNextFile(); - while (file) + if (file) { String fileName = file.name(); - if (selectedFile == "" && !fileName.startsWith(".")) + if (!fileName.startsWith(".")) selectedFile = fileName; file.close(); - file = root.openNextFile(); } -// Wifi + // Wifi #ifdef B_WIFI_AP Serial.println("Setting up AP..."); WiFi.softAP(ssid, password); @@ -113,6 +112,7 @@ void setup() server.on("/select-file", HTTP_POST, onSelectFile); server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html"); server.begin(); + Serial.println("Server ready!"); }