diff --git a/src/common/memory.c b/src/common/memory.c index 0f38a3d..75b6341 100644 --- a/src/common/memory.c +++ b/src/common/memory.c @@ -2,14 +2,21 @@ #include -static int WriteRaw(word addr, byte data); +#define MEM_SIZE 1024 +#define BLOCK_SIZE sizeof(mem_data_t) +#define MAX_BLOCKS (MEM_SIZE / BLOCK_SIZE) +#define SENTINEL_MASK BIT(8) + static byte ReadRaw(word addr); +static int WriteRaw(word addr, byte data); +static word GetBlockAddress(void); int MEM_Read(mem_data_t *out) { // TODO UNUSED(out); UNUSED(ReadRaw); + UNUSED(GetBlockAddress); return 0; } @@ -30,6 +37,11 @@ void MEM_Dump(void) // } } +static word GetBlockAddress(void) +{ + return 0; +} + static int WriteRaw(word addr, byte data) { // The EEMWE bit determines whether setting EEWE to diff --git a/src/main.c b/src/main.c index b753c70..9924207 100644 --- a/src/main.c +++ b/src/main.c @@ -6,6 +6,7 @@ #include +// TODO: Config header for chip specifics like EEPROM size. // TODO: Implement primary state machine for update loop. // TODO: Migrate to ATMega 1284P-PU for 2nd 16-bit timer. // TODO: Keep persistent TEMP and DEWP targets in EEPROM.