feat: format sd card screen

This commit is contained in:
Stanislav Khromov
2026-01-14 01:36:37 +01:00
parent 52995fa722
commit f4ced6ac7b
3 changed files with 185 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
#include "CalibreSettingsActivity.h"
#include "CrossPointSettings.h"
#include "FormatSDCardActivity.h"
#include "MappedInputManager.h"
#include "OtaUpdateActivity.h"
#include "fontIds.h"
@@ -41,7 +42,8 @@ const SettingInfo settingsList[settingsCount] = {
SettingInfo::Enum("Refresh Frequency", &CrossPointSettings::refreshFrequency,
{"1 page", "5 pages", "10 pages", "15 pages", "30 pages"}),
SettingInfo::Action("Calibre Settings"),
SettingInfo::Action("Check for updates")};
SettingInfo::Action("Check for updates"),
SettingInfo::Action("Format SD Card")};
} // namespace
void SettingsActivity::taskTrampoline(void* param) {
@@ -154,6 +156,14 @@ void SettingsActivity::toggleCurrentSetting() {
updateRequired = true;
}));
xSemaphoreGive(renderingMutex);
} else if (strcmp(setting.name, "Format SD Card") == 0) {
xSemaphoreTake(renderingMutex, portMAX_DELAY);
exitActivity();
enterNewActivity(new FormatSDCardActivity(renderer, mappedInput, [this] {
exitActivity();
updateRequired = true;
}));
xSemaphoreGive(renderingMutex);
}
} else {
// Only toggle if it's a toggle type and has a value pointer