mash/mash.c

changeset 147
0e7c51a66b5e
parent 103
99c47a8a61cb
equal deleted inserted replaced
146:11f431ac253d 147:0e7c51a66b5e
23 #include "mash.h" 23 #include "mash.h"
24 #include "lock.h" 24 #include "lock.h"
25 #include "logger.h" 25 #include "logger.h"
26 #include "xutil.h" 26 #include "xutil.h"
27 #include "beerxml.h" 27 #include "beerxml.h"
28 #include "lcd-pcf8574.h"
29 #include "sensors.h"
30
28 31
29 #ifdef HAVE_WIRINGPI_H 32 #ifdef HAVE_WIRINGPI_H
30 33
34 /* wiringPi */
35 #include <wiringPi.h>
36 #include <pcf8574.h>
37 #include <lcd.h>
31 38
32 int tempA = 80; 39 int tempA = 80;
33 int tempB = 80; 40 int tempB = 80;
34 int coolerA = 0; 41 int coolerA = 0;
35 int coolerB = 0; 42 int coolerB = 0;
36 43
37 bool my_shutdown = false; 44 int my_shutdown = FALSE;
38 static pid_t pgrp, mypid; 45 static pid_t pgrp, mypid;
39 46
40 extern bool debug; 47 extern int debug;
41 extern sys_config Config; 48 extern sys_config Config;
42 extern int lcdHandle; 49 extern int lcdHandle;
43 extern unsigned char lcdbuf[MAX_LCDS][20][4]; 50 extern unsigned char lcdbuf[MAX_LCDS][20][4];
44 int lcdupdate; 51 int lcdupdate;
45 52
70 case SIGTERM: syslog(LOG_NOTICE, "Got SIGTERM, shutting down"); 77 case SIGTERM: syslog(LOG_NOTICE, "Got SIGTERM, shutting down");
71 break; 78 break;
72 default: syslog(LOG_NOTICE, "die() on signal %d", onsig); 79 default: syslog(LOG_NOTICE, "die() on signal %d", onsig);
73 } 80 }
74 81
75 my_shutdown = true; 82 my_shutdown = TRUE;
76 } 83 }
77 84
78 85
79 86
80 void stopLCD(void) 87 void stopLCD(void)
102 c = getopt_long(argc, argv, "dh", long_options, &option_index); 109 c = getopt_long(argc, argv, "dh", long_options, &option_index);
103 if (c == -1) 110 if (c == -1)
104 break; 111 break;
105 112
106 switch (c) { 113 switch (c) {
107 case 'd': debug = true; 114 case 'd': debug = TRUE;
108 break; 115 break;
109 case 'h': help(); 116 case 'h': help();
110 return 1; 117 return 1;
111 } 118 }
112 } 119 }

mercurial