--- a/brewco/brewco.c Thu Dec 10 15:58:01 2015 +0100 +++ b/brewco/brewco.c Thu Dec 10 17:31:45 2015 +0100 @@ -104,6 +104,31 @@ +void tempstatus(float hlttemp, float mlttemp) +{ + char text[81]; + + snprintf(text, 7, "%5.1f\001", hlttemp); +#ifdef HAVE_WIRINGPI_H + piLock(LOCK_LCD); + lcdPosition(lcdHandle, 2, 1); + lcdPuts(lcdHandle, text); +#endif + slcdPosition(slcdHandle, 2, 1); + slcdPuts(slcdHandle, text); + + snprintf(text, 7, "%5.1f\001", mlttemp); +#ifdef HAVE_WIRINGPI_H + piLock(LOCK_LCD); + lcdPosition(lcdHandle, 11, 1); + lcdPuts(lcdHandle, text); +#endif + slcdPosition(slcdHandle, 11, 1); + slcdPuts(slcdHandle, text); +} + + + int server(void); int server(void) { @@ -273,8 +298,14 @@ manual = MANUAL_SELMLT; if (key == KEY_RETURN) manual = MANUAL_NONE; - if (key == KEY_ENTER) + if (key == KEY_ENTER) { + // TODO: prompt for water manual = MANUAL_HLT; + prompt(0, NULL); + device_out(unit->hlt_heater.uuid, man_hlt_heat); + device_out(unit->mlt_heater.uuid, man_mlt_heat); + device_out(unit->mlt_pump.uuid, man_mlt_pump); + } break; case MANUAL_SELMLT: prompt(0, NULL); prompt(104, NULL); @@ -285,11 +316,16 @@ manual = MANUAL_SELHLT; if (key == KEY_RETURN) manual = MANUAL_NONE; - if (key == KEY_ENTER) + if (key == KEY_ENTER) { + // TODO: prompt for water manual = MANUAL_MLT; + prompt(0, NULL); + device_out(unit->hlt_heater.uuid, man_hlt_heat); + device_out(unit->mlt_heater.uuid, man_mlt_heat); + device_out(unit->mlt_pump.uuid, man_mlt_pump); + } break; - case MANUAL_HLT: prompt(0, NULL); - prompt(104, NULL); + case MANUAL_HLT: prompt(104, NULL); prompt(413, NULL); key = keywait(); @@ -307,8 +343,7 @@ if (debug) fprintf(stdout, "device_out(%s, %d) HLT heater\n", unit->hlt_heater.uuid, man_hlt_heat); break; - case MANUAL_MLT: prompt(0, NULL); - prompt(104, NULL); + case MANUAL_MLT: prompt(104, NULL); prompt(406, NULL); key = keywait(); if (key == KEY_RETURN) { @@ -338,6 +373,7 @@ prompt(0, NULL); prompt(101, NULL); prompt(401, NULL); + tempstatus(120.3, 165.34); key = keywait(); if (key == KEY_ENTER) setup();