Update documentation and do some basic housekeeping

This commit is contained in:
2024-09-25 17:16:20 +02:00
parent c8854931e8
commit aa0cd89d4e
20 changed files with 167 additions and 57 deletions

View File

@@ -62,19 +62,19 @@ void MEM_Write(mem_block_t *in)
WriteBlock(head, in);
}
int MEM_Read(mem_block_t *out)
bool MEM_Read(mem_block_t *out)
{
int head;
head = GetUsedBlock();
if (head < 0) { // Empty?
return -1;
return false;
}
ReadBlock(head, out);
return 0;
return true;
}
void MEM_Free(void)

View File

@@ -1,6 +1,8 @@
#ifndef MAD_CORE_COMMON_MEMORY_H
#define MAD_CORE_COMMON_MEMORY_H
#include "common/types.h"
typedef struct mem_block_s mem_block_t;
// Important: Must reset EEPROM memory when the size of
@@ -13,7 +15,7 @@ struct mem_block_s {
} __attribute__((packed));
void MEM_Write(mem_block_t *in);
int MEM_Read(mem_block_t *out);
bool MEM_Read(mem_block_t *out);
void MEM_Free(void);
void MEM_Dump(void);