diff --git a/heat.c b/heat.c index 5a18d6d..bfff8ed 100644 --- a/heat.c +++ b/heat.c @@ -61,7 +61,8 @@ void resetHeatOk(void) bool isHeatOk(void) { - return (tAct > T_STEP_THRESH && tAct < T_HOLD_THRESH); + heat_ok = (tAct > T_HOLD_THRESH); + return heat_ok; } void* processHeat(void* arg) diff --git a/hvc.c b/hvc.c index c829cac..27b28e8 100644 --- a/hvc.c +++ b/hvc.c @@ -51,12 +51,12 @@ int tempCons; void setPumpOn() { - pumped = 0; setPumpWantedState(true); } void setPumpOff() { + pumped = 0; setPumpWantedState(false); } @@ -142,7 +142,7 @@ void* processHVC(void* we) while(!hvcStop) { - printx(DEBUG, HVC, "Querying data\n"); + printx(DEBUG, HVC, "Querying data, with prev PUMP %d\n", pumped); sendData(&hvc_fd, GET_TEMP); data = getData(&hvc_fd); setTemp(data); diff --git a/main.c b/main.c index 79a3771..b1b790b 100644 --- a/main.c +++ b/main.c @@ -52,6 +52,7 @@ int main(void) pthread_create(&tHeat, NULL, processHeat, NULL); pthread_create(&tPump, NULL, processPump, NULL); + sleep(20); setVolWanted(1); setCoffeeWanted(); diff --git a/pump.c b/pump.c index b2d47bf..d246228 100644 --- a/pump.c +++ b/pump.c @@ -173,7 +173,7 @@ void* processPump(void* arg) } } - usleep(20000); + sleep(1); } return NULL; -- libgit2 0.21.2