Storage: format the SD card as one FAT32 partition

Repartitions the whole card (f_fdisk + f_mkfs) on the storage task.
Temporarily triggered from the diagnostics screen by typing FORMAT and
Enter; moves to Settings > Storage in step 7.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-02 10:17:41 +02:00
co-authored by Claude Opus 5.5
parent 44de78ea62
commit 36ebd23417
3 changed files with 56 additions and 3 deletions
+10 -1
View File
@@ -23,6 +23,7 @@ static PowerService* power;
static ClockService* clockService;
static String lastKey = "-";
static String typed; // last characters typed, for the FORMAT confirmation
static String lastEvent = "-";
static bool dirty = true;
@@ -55,7 +56,7 @@ static void draw() {
line("Key: " + lastKey);
line("Event: " + lastEvent);
d.setTextColor(TFT_DARKGREY);
line("+/- brightness, d: dim test (5s/10s)");
line(storage->formatting() ? "Formatting SD card..." : "+/- bright, d: dim test, FORMAT+enter: wipe SD");
}
static void logEvent(const String& text) {
@@ -103,6 +104,14 @@ static void handleKeys() {
(state.enter ? " enter" : "") + (state.del ? " del" : "");
dirty = true;
if (state.enter) {
if (typed.endsWith("FORMAT") && storage->requestFormat()) logEvent("format requested");
typed = "";
} else {
typed += word;
if (typed.length() > 16) typed.remove(0, typed.length() - 16);
}
int brightness = settings.getInt(Setting::Brightness);
if (word == "=" || word == "+") settings.setInt(Setting::Brightness, brightness + 10);
if (word == "-") settings.setInt(Setting::Brightness, brightness - 10);