Pass variable structure as argument for memory functions
This commit is contained in:
17
src/main.c
17
src/main.c
@@ -32,6 +32,8 @@ static word dewp, dewp_target;
|
||||
|
||||
static int Init(void)
|
||||
{
|
||||
mem_block_t mem;
|
||||
|
||||
state = S_IDLE;
|
||||
|
||||
// MOSFETS control things like the heating element
|
||||
@@ -73,12 +75,17 @@ static int Init(void)
|
||||
// used.
|
||||
|
||||
MEM_Init();
|
||||
MEM_Read(&temp_target, &dewp_target);
|
||||
Info("Persistent memory contains [%d, %d]",
|
||||
temp_target, dewp_target);
|
||||
|
||||
// MEM_Write(20, 60);
|
||||
// MEM_Dump();
|
||||
// mem.temp = 30.50f;
|
||||
// mem.dewp = 15.25f;
|
||||
// MEM_Write(&mem);
|
||||
// MEM_Free();
|
||||
|
||||
if (MEM_Read(&mem) == 0) {
|
||||
Info("Found persistent configuration in EEPROM!");
|
||||
Info("Setting targets TEMP='%.2f', DEWP='%.2f'.",
|
||||
mem.temp, mem.dewp);
|
||||
}
|
||||
|
||||
// There is a possiblity to use interrupt signals
|
||||
// for I2C communication but only as one large
|
||||
|
||||
Reference in New Issue
Block a user