mirror of
https://github.com/Crocmagnon/buzzer.git
synced 2024-11-22 07:58:02 +01:00
Cleanup setup
This commit is contained in:
parent
b67b057d48
commit
418499aff8
1 changed files with 4 additions and 4 deletions
|
@ -80,16 +80,15 @@ void setup()
|
||||||
// List existing files
|
// List existing files
|
||||||
File root = SPIFFS.open("/music");
|
File root = SPIFFS.open("/music");
|
||||||
File file = root.openNextFile();
|
File file = root.openNextFile();
|
||||||
while (file)
|
if (file)
|
||||||
{
|
{
|
||||||
String fileName = file.name();
|
String fileName = file.name();
|
||||||
if (selectedFile == "" && !fileName.startsWith("."))
|
if (!fileName.startsWith("."))
|
||||||
selectedFile = fileName;
|
selectedFile = fileName;
|
||||||
file.close();
|
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...");
|
||||||
WiFi.softAP(ssid, password);
|
WiFi.softAP(ssid, password);
|
||||||
|
@ -113,6 +112,7 @@ void setup()
|
||||||
server.on("/select-file", HTTP_POST, onSelectFile);
|
server.on("/select-file", HTTP_POST, onSelectFile);
|
||||||
server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html");
|
server.serveStatic("/", SPIFFS, "/www/").setDefaultFile("index.html");
|
||||||
server.begin();
|
server.begin();
|
||||||
|
|
||||||
Serial.println("Server ready!");
|
Serial.println("Server ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue