Implement memory wear leveling algorithm

This commit is contained in:
2024-09-20 21:30:31 +02:00
parent e2b5c5fd42
commit 10298a99c1
3 changed files with 162 additions and 50 deletions

View File

@@ -1,15 +1,13 @@
#ifndef MAD_CORE_COMMON_MEMORY_H
#define MAD_CORE_COMMON_MEMORY_H
typedef struct mem_data_s mem_data_t;
#define M_TEMPERATURE 0
#define M_DEWPOINT 1
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);
void MEM_Init(void);
void MEM_Write(word temp, word dewp);
void MEM_Read(word *temp, word *dewp);
void MEM_Free(void);
void MEM_Dump(void);
#endif // MAD_CORE_COMMON_MEMORY_H