Redesign to keepsake Memory Frame: config file based named memories with beautiful mobile web dashboard, upload wizard, and delete flow
This commit is contained in:
@@ -4,19 +4,45 @@
|
||||
#include "FS.h"
|
||||
#include "SD_MMC.h"
|
||||
|
||||
// SD card MMC pins (1-bit mode to avoid GPIO 21 conflict with LCD_CS)
|
||||
#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;
|
||||
|
||||
// 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);
|
||||
uint16_t Folder_retrieval(const char* directory, const char* fileExtension,
|
||||
char File_Name[][100], uint16_t maxFiles);
|
||||
void remove_file_extension(char* file_name);
|
||||
|
||||
Reference in New Issue
Block a user