From 3d38d7cde4362dd339efd5e4887cf2c320d23752 Mon Sep 17 00:00:00 2001 From: drkhsh Date: Mon, 27 Apr 2026 18:51:03 +0200 Subject: [PATCH] FlashStore: fall back to "spiffs" partition label bmorcelli/Launcher labels its user-app data partition "spiffs"; ours is "littlefs". Subtype is identical in both layouts, so try littlefs first and fall back to spiffs to coexist with Launcher installs. --- src/storage/FlashStore.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/storage/FlashStore.cpp b/src/storage/FlashStore.cpp index 88a2138..b93dcac 100644 --- a/src/storage/FlashStore.cpp +++ b/src/storage/FlashStore.cpp @@ -1,16 +1,21 @@ #include "FlashStore.h" bool FlashStore::begin() { - // Partition label must match partitions_16MB.csv ("littlefs") - // Arduino ESP32 LittleFS defaults to "spiffs" label, so we must specify it - if (!LittleFS.begin(true, "/littlefs", 10, "littlefs")) { - Serial.println("[FLASH] LittleFS mount failed, formatting..."); - LittleFS.format(); - if (!LittleFS.begin(false, "/littlefs", 10, "littlefs")) { - Serial.println("[FLASH] LittleFS failed after format!"); - return false; + // Standalone ratdeck labels this partition "littlefs"; bmorcelli/Launcher + // labels the equivalent partition "spiffs". Try ours first, fall back. + const char* labels[] = { "littlefs", "spiffs" }; + bool mounted = false; + for (const char* label : labels) { + if (LittleFS.begin(true, "/littlefs", 10, label)) { + Serial.printf("[FLASH] LittleFS mounted on partition '%s'\n", label); + mounted = true; + break; } } + if (!mounted) { + Serial.println("[FLASH] LittleFS mount failed on all known labels!"); + return false; + } _ready = true; ensureDir("/identity");