diff --git a/src/common.h b/src/common.h index f1d0c78..ae5ad53 100644 --- a/src/common.h +++ b/src/common.h @@ -4,6 +4,7 @@ #include "common/math.h" #include "common/types.h" #include "common/watchdog.h" +#include "common/eeprom.h" #include #include diff --git a/src/common/eeprom.c b/src/common/eeprom.c new file mode 100644 index 0000000..a250306 --- /dev/null +++ b/src/common/eeprom.c @@ -0,0 +1,17 @@ +#include "common.h" + +// TODO: Implement EEPROM storage with wear leveling + +int MEM_Read(mem_data_t *out) +{ + UNUSED(out); + + return 0; +} + +int MEM_Write(mem_data_t *in) +{ + UNUSED(in); + + return 0; +} diff --git a/src/common/eeprom.h b/src/common/eeprom.h new file mode 100644 index 0000000..4b6eeb8 --- /dev/null +++ b/src/common/eeprom.h @@ -0,0 +1,14 @@ +#ifndef MAD_CORE_COMMON_EEPROM_H +#define MAD_CORE_COMMON_EEPROM_H + +typedef struct mem_data_s mem_data_t; + +struct mem_data_s { + byte sentinel; // Data marker bit + word value[2]; // Values to be written +}; + +int MEM_Read(mem_data_t *out); +int MEM_Write(mem_data_t *in); + +#endif // MAD_CORE_COMMON_EEPROM_H