brewco/devices.c

changeset 471
1564b60558b1
parent 458
43a8ecb53637
child 473
fdd30e935079
equal deleted inserted replaced
470:c2794ae0def3 471:1564b60558b1
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/ 21 *****************************************************************************/
22 22
23 #include "brewco.h" 23 #include "brewco.h"
24 #include "devices.h" 24 #include "devices.h"
25 #include "util.h"
25 #include "xutil.h" 26 #include "xutil.h"
26 #include "keyboard.h" 27 #include "keyboard.h"
27 #include "slcd.h" 28 #include "slcd.h"
28 29
29 30
135 136
136 137
137 138
138 void hlt_heater(int value) 139 void hlt_heater(int value)
139 { 140 {
140 #ifdef HAVE_WIRINGPI_H
141 piLock(LOCK_LCD);
142 lcdPosition(lcdHandle, 0, 1);
143 #endif
144 slcdPosition(slcdHandle, 0, 1);
145 if (value) { 141 if (value) {
146 leds |= SLED_HLTH; 142 leds |= SLED_HLTH;
147 #ifdef HAVE_WIRINGPI_H
148 lcdPutchar(lcdHandle, 5);
149 #endif
150 slcdPutchar(slcdHandle, 5);
151 } else { 143 } else {
152 leds &= ~SLED_HLTH; 144 leds &= ~SLED_HLTH;
153 #ifdef HAVE_WIRINGPI_H 145 }
154 lcdPutchar(lcdHandle, 6);
155 #endif
156 slcdPutchar(slcdHandle, 6);
157 }
158 #ifdef HAVE_WIRINGPI_H
159 piUnlock(LOCK_LCD);
160 #endif
161 slcdLEDs(slcdHandle); 146 slcdLEDs(slcdHandle);
162 } 147 }
163 148
164 149
165 150
166 void mlt_heater(int value) 151 void mlt_heater(int value)
167 { 152 {
168 #ifdef HAVE_WIRINGPI_H
169 piLock(LOCK_LCD);
170 lcdPosition(lcdHandle, 18, 1);
171 #endif
172 slcdPosition(slcdHandle, 18, 1);
173 if (value) { 153 if (value) {
174 leds |= SLED_MLTH; 154 leds |= SLED_MLTH;
175 #ifdef HAVE_WIRINGPI_H
176 lcdPutchar(lcdHandle, 5);
177 #endif
178 slcdPutchar(slcdHandle, 5);
179 } else { 155 } else {
180 leds &= ~SLED_MLTH; 156 leds &= ~SLED_MLTH;
181 #ifdef HAVE_WIRINGPI_H 157 }
182 lcdPutchar(lcdHandle, 6);
183 #endif
184 slcdPutchar(slcdHandle, 6);
185 }
186 #ifdef HAVE_WIRINGPI_H
187 piUnlock(LOCK_LCD);
188 #endif
189 slcdLEDs(slcdHandle); 158 slcdLEDs(slcdHandle);
190 } 159 }
191 160
192 161
193 162
194 void mlt_pump(int value) 163 void mlt_pump(int value)
195 { 164 {
196 #ifdef HAVE_WIRINGPI_H 165 pump_status(value);
197 piLock(LOCK_LCD);
198 lcdPosition(lcdHandle, 19, 1);
199 #endif
200 slcdPosition(slcdHandle, 19, 1);
201 if (value) { 166 if (value) {
202 leds |= SLED_MLTP; 167 leds |= SLED_MLTP;
203 #ifdef HAVE_WIRINGPI_H
204 lcdPutchar(lcdHandle, 3);
205 #endif
206 slcdPutchar(slcdHandle, 3);
207 } else { 168 } else {
208 leds &= ~SLED_MLTP; 169 leds &= ~SLED_MLTP;
209 #ifdef HAVE_WIRINGPI_H 170 }
210 lcdPutchar(lcdHandle, 4);
211 #endif
212 slcdPutchar(slcdHandle, 4);
213 }
214 #ifdef HAVE_WIRINGPI_H
215 piUnlock(LOCK_LCD);
216 #endif
217 slcdLEDs(slcdHandle); 171 slcdLEDs(slcdHandle);
218 } 172 }
219 173
220 174
221 175

mercurial