46 #ifndef HAVE_WIRINGPI_H |
46 #ifndef HAVE_WIRINGPI_H |
47 pthread_t threads[5]; |
47 pthread_t threads[5]; |
48 #endif |
48 #endif |
49 |
49 |
50 |
50 |
|
51 /* |
|
52 * CGRAM characters |
|
53 */ |
|
54 unsigned char degC[8] = { 0b01000, 0b10100, 0b01000, 0b00111, 0b01000, 0b01000, 0b01000, 0b00111 }; |
|
55 unsigned char degF[8] = { 0b01000, 0b10100, 0b01000, 0b00111, 0b00100, 0b00110, 0b00100, 0b00100 }; |
|
56 unsigned char SP_Symbol[8] = { 0b11100, 0b10000, 0b11100, 0b00111, 0b11101, 0b00111, 0b00100, 0b00100 }; |
|
57 unsigned char PumpONOFF[8] = { 0b00000, 0b01110, 0b01010, 0b01110, 0b01000, 0b01000, 0b01000, 0b00000 }; |
|
58 unsigned char RevPumpONOFF[8] = { 0b11111, 0b10001, 0b10101, 0b10001, 0b10111, 0b10111, 0b10111, 0b11111 }; |
|
59 unsigned char HeatONOFF[8] = { 0b00000, 0b01010, 0b01010, 0b01110, 0b01110, 0b01010, 0b01010, 0b00000 }; |
|
60 unsigned char RevHeatONOFF[8] = { 0b11111, 0b10101, 0b10101, 0b10001, 0b10001, 0b10101, 0b10101, 0b11111 }; |
|
61 unsigned char Language[8] = { 0b11111, 0b00010, 0b01000, 0b11111, 0b00000, 0b10001, 0b10101, 0b11111 }; |
|
62 |
|
63 |
51 void help(void); |
64 void help(void); |
52 void die(int); |
65 void die(int); |
53 |
66 |
54 |
67 |
55 |
68 |
91 units_list *unit; |
104 units_list *unit; |
92 brew_session *brew = NULL; |
105 brew_session *brew = NULL; |
93 #ifndef HAVE_WIRINGPI_H |
106 #ifndef HAVE_WIRINGPI_H |
94 long t = 0; |
107 long t = 0; |
95 #endif |
108 #endif |
|
109 |
|
110 prompt(101, NULL); |
|
111 |
|
112 /* |
|
113 * Define special characters in the display CGRAM |
|
114 */ |
|
115 if (Config.tempFormat == 'C') |
|
116 slcdCharDef(slcdHandle, 1, degC); |
|
117 else |
|
118 slcdCharDef(slcdHandle, 1, degF); |
|
119 slcdCharDef(slcdHandle, 2, SP_Symbol); |
|
120 slcdCharDef(slcdHandle, 3, PumpONOFF); |
|
121 slcdCharDef(slcdHandle, 4, RevPumpONOFF); |
|
122 slcdCharDef(slcdHandle, 5, HeatONOFF); |
|
123 slcdCharDef(slcdHandle, 6, RevHeatONOFF); |
|
124 slcdCharDef(slcdHandle, 7, Language); |
96 |
125 |
97 // if (lockprog((char *)"brewco")) { |
126 // if (lockprog((char *)"brewco")) { |
98 // syslog(LOG_NOTICE, "Can't lock"); |
127 // syslog(LOG_NOTICE, "Can't lock"); |
99 // return 1; |
128 // return 1; |
100 // } |
129 // } |
168 if (unit->mlt_pump) |
197 if (unit->mlt_pump) |
169 unit->mlt_pump->value = 0; |
198 unit->mlt_pump->value = 0; |
170 } |
199 } |
171 } |
200 } |
172 |
201 |
173 prompt(101); |
|
174 if (! Config.units) { |
202 if (! Config.units) { |
175 /* |
203 /* |
176 * No brewsystems defined, add the first |
204 * No brewsystems defined, add the first |
177 */ |
205 */ |
178 prompt(218); /* Add Brewsystem? */ |
206 prompt(218, NULL); /* Add Brewsystem? */ |
179 prompt(407); /* --- --- Ok --- */ |
207 prompt(407, NULL); /* --- --- Ok --- */ |
180 |
208 |
181 do { |
209 do { |
182 key = keywait(); |
210 key = keywait(); |
183 } while (key != KEY_RETURN); |
211 } while (key != KEY_RETURN); |
184 |
212 |
231 |
260 |
232 syslog(LOG_NOTICE, "Out of loop"); |
261 syslog(LOG_NOTICE, "Out of loop"); |
233 if (debug) |
262 if (debug) |
234 fprintf(stdout, (char *)"Out of loop\n"); |
263 fprintf(stdout, (char *)"Out of loop\n"); |
235 |
264 |
236 prompt(0); |
265 prompt(0, NULL); |
237 prompt(101); |
266 prompt(101, NULL); |
238 prompt(302); |
267 prompt(302, NULL); |
239 |
268 |
240 /* |
269 /* |
241 * Stop units processing in a neat way |
270 * Stop units processing in a neat way |
242 */ |
271 */ |
243 for (unit = Config.units; unit; unit = unit->next) { |
272 for (unit = Config.units; unit; unit = unit->next) { |