diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 080e70d..df6fb61 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,6 +2,7 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ + "diegoomal.ollama-connection", "platformio.platformio-ide" ], "unwantedRecommendations": [ diff --git a/README.md b/README.md index 7123a28..e35ba88 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ We use three buttons, preferably big and robust. They are grounded if closed, so Start / Stop -> 17 and GND Wake up / Next -> 04 and GND Previous -> 16 and GND + +#define BTN_START_STOP 4 // Button on XX and GND +#define BTN_NEXT 17 +#define BTN_PREV 16 ``` ## Battery Voltage diff --git a/platformio.ini b/platformio.ini index 8ce05c9..ed30f57 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,5 +1,5 @@ ; PlatformIO Project Configuration File -; +; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags ; Library options: dependencies, extra library storages diff --git a/src/DirectoryNode.cpp b/src/DirectoryNode.cpp index 6af7cd6..9a7b994 100644 --- a/src/DirectoryNode.cpp +++ b/src/DirectoryNode.cpp @@ -87,6 +87,15 @@ uint32_t DirectoryNode::getSecondsPlayed() void DirectoryNode::buildDirectoryTree(const char *currentPath) { + // Clear existing data to prevent duplicates when rebuilding + for (DirectoryNode *childNode : subdirectories) + { + delete childNode; + } + subdirectories.clear(); + mp3Files.clear(); + ids.clear(); + File rootDir = SD.open(currentPath); while (true) { diff --git a/src/WebContent.h b/src/WebContent.h index 3619581..ebdc171 100644 --- a/src/WebContent.h +++ b/src/WebContent.h @@ -37,13 +37,23 @@ const char index_html[] PROGMEM = R"rawliteral( --> -
+