Define memory manager constants and add TODO
This commit is contained in:
@@ -2,14 +2,21 @@
|
|||||||
|
|
||||||
#include <util/atomic.h>
|
#include <util/atomic.h>
|
||||||
|
|
||||||
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 byte ReadRaw(word addr);
|
||||||
|
static int WriteRaw(word addr, byte data);
|
||||||
|
static word GetBlockAddress(void);
|
||||||
|
|
||||||
int MEM_Read(mem_data_t *out)
|
int MEM_Read(mem_data_t *out)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
UNUSED(out);
|
UNUSED(out);
|
||||||
UNUSED(ReadRaw);
|
UNUSED(ReadRaw);
|
||||||
|
UNUSED(GetBlockAddress);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,6 +37,11 @@ void MEM_Dump(void)
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static word GetBlockAddress(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int WriteRaw(word addr, byte data)
|
static int WriteRaw(word addr, byte data)
|
||||||
{
|
{
|
||||||
// The EEMWE bit determines whether setting EEWE to
|
// The EEMWE bit determines whether setting EEWE to
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
|
// TODO: Config header for chip specifics like EEPROM size.
|
||||||
// TODO: Implement primary state machine for update loop.
|
// TODO: Implement primary state machine for update loop.
|
||||||
// TODO: Migrate to ATMega 1284P-PU for 2nd 16-bit timer.
|
// TODO: Migrate to ATMega 1284P-PU for 2nd 16-bit timer.
|
||||||
// TODO: Keep persistent TEMP and DEWP targets in EEPROM.
|
// TODO: Keep persistent TEMP and DEWP targets in EEPROM.
|
||||||
|
|||||||
Reference in New Issue
Block a user