#pragma once #include "Arduino.h" #include #include "FS.h" #include "SD_MMC.h" // SD card MMC pins (4-bit mode, fully compatible now LCD_CS is on GPIO 42) #define SD_CLK_PIN 14 #define SD_CMD_PIN 15 #define SD_D0_PIN 16 #define SD_D1_PIN 18 #define SD_D2_PIN 17 #define SD_D3_PIN 21 #define MAX_MEMORIES 50 #define MAX_NAME_LEN 64 #define MAX_FILE_LEN 64 // A single named memory: photo + audio pair struct Memory { int id; char name[MAX_NAME_LEN]; char photo[MAX_FILE_LEN]; // filename only, lives in /photos/ char audio[MAX_FILE_LEN]; // filename only, lives in /audio/ }; // Global memory list & settings extern Memory g_memories[MAX_MEMORIES]; extern int g_memoryCount; extern int g_currentIndex; extern uint8_t g_volume; extern uint16_t SDCard_Size; extern uint16_t Flash_Size; // Tribute Alarm Settings extern bool g_tributeAlarmEnabled; extern int g_tributeAlarmHour; extern int g_tributeAlarmMinute; extern int g_timezoneOffset; extern bool g_timeSynchronized; extern int g_favoriteMemoryId; // SD init void SD_Init(); void Flash_test(); // Config load / save bool Config_Load(); bool Config_Save(); // Memory CRUD int Config_Add_Memory(const char* name, const char* photo, const char* audio); bool Config_Delete_Memory(int id); // Low-level helpers (kept for legacy use) bool File_Search(const char* directory, const char* fileName); uint16_t Folder_retrieval(const char* directory, const char* fileExtension, char File_Name[][100], uint16_t maxFiles); void remove_file_extension(char* file_name);