Pass variable structure as argument for memory functions
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
#ifndef MAD_CORE_COMMON_MEMORY_H
|
||||
#define MAD_CORE_COMMON_MEMORY_H
|
||||
|
||||
#define M_TEMPERATURE 0
|
||||
#define M_DEWPOINT 1
|
||||
typedef struct mem_block_s mem_block_t;
|
||||
|
||||
// Important: Must reset EEPROM memory when the size of
|
||||
// mem_block_s is changed. Also the flag value must be
|
||||
// kept at the first position of the struct.
|
||||
|
||||
struct mem_block_s {
|
||||
byte flag;
|
||||
float temp, dewp;
|
||||
} __attribute__((packed));
|
||||
|
||||
void MEM_Init(void);
|
||||
void MEM_Write(word temp, word dewp);
|
||||
void MEM_Read(word *temp, word *dewp);
|
||||
void MEM_Write(mem_block_t *in);
|
||||
int MEM_Read(mem_block_t *out);
|
||||
void MEM_Free(void);
|
||||
void MEM_Dump(void);
|
||||
|
||||
#endif // MAD_CORE_COMMON_MEMORY_H
|
||||
|
||||
Reference in New Issue
Block a user