Support optional soundbites (adds Skip option in wizard), updates look and feel to a gorgeous sunflower theme, and adds a daily Tribute Time Alarm feature synced automatically with the phone time

This commit is contained in:
drjones
2026-07-04 02:33:32 -07:00
parent 617741f773
commit 2c19aeb6a9
4 changed files with 450 additions and 126 deletions

View File

@@ -8,6 +8,13 @@ uint8_t g_volume = 12;
uint16_t SDCard_Size = 0;
uint16_t Flash_Size = 0;
// Tribute Alarm Settings Globals
bool g_tributeAlarmEnabled = false;
int g_tributeAlarmHour = 19;
int g_tributeAlarmMinute = 0;
int g_timezoneOffset = 0;
bool g_timeSynchronized = false;
// ── SD Init ───────────────────────────────────────────────────────────────────
void SD_Init() {
if (!SD_MMC.setPins(SD_CLK_PIN, SD_CMD_PIN, SD_D0_PIN)) {
@@ -80,6 +87,18 @@ bool Config_Load() {
g_currentIndex = atoi(line + 6);
continue;
}
if (strncmp(line, "ALARM|", 6) == 0) {
// Parse: ALARM|enabled|hour|minute|timezone_offset
char* tok = strtok(line + 6, "|");
if (tok) g_tributeAlarmEnabled = (atoi(tok) != 0);
tok = strtok(NULL, "|");
if (tok) g_tributeAlarmHour = atoi(tok);
tok = strtok(NULL, "|");
if (tok) g_tributeAlarmMinute = atoi(tok);
tok = strtok(NULL, "|");
if (tok) g_timezoneOffset = atoi(tok);
continue;
}
// Parse memory line: id|name|photo|audio
if (g_memoryCount >= MAX_MEMORIES) continue;
@@ -120,6 +139,7 @@ bool Config_Save() {
}
f.printf("VOLUME|%d\n", g_volume);
f.printf("INDEX|%d\n", g_currentIndex);
f.printf("ALARM|%d|%d|%d|%d\n", g_tributeAlarmEnabled ? 1 : 0, g_tributeAlarmHour, g_tributeAlarmMinute, g_timezoneOffset);
for (int i = 0; i < g_memoryCount; i++) {
Memory& m = g_memories[i];
f.printf("%d|%s|%s|%s\n", m.id, m.name, m.photo, m.audio);