150 if ((i != SIGCHLD) && (i != SIGKILL) && (i != SIGSTOP)) |
152 if ((i != SIGCHLD) && (i != SIGKILL) && (i != SIGSTOP)) |
151 signal(i, (void (*))die); |
153 signal(i, (void (*))die); |
152 } |
154 } |
153 |
155 |
154 if (wiringPiSetup () ) |
156 if (wiringPiSetup () ) |
|
157 return 1; |
|
158 |
|
159 if (server_init() ) |
155 return 1; |
160 return 1; |
156 |
161 |
157 if ((rc = initLCD (16, 2))) { |
162 if ((rc = initLCD (16, 2))) { |
158 fprintf(stderr, "Cannot initialize LCD display, rc=%d\n", rc); |
163 fprintf(stderr, "Cannot initialize LCD display, rc=%d\n", rc); |
159 return 1; |
164 return 1; |
256 if (rc) { |
261 if (rc) { |
257 fprintf(stderr, "my_sensors_loop thread didn't start rc=%d\n", rc); |
262 fprintf(stderr, "my_sensors_loop thread didn't start rc=%d\n", rc); |
258 syslog(LOG_NOTICE, "my_sensors_loop thread didn't start rc=%d", rc); |
263 syslog(LOG_NOTICE, "my_sensors_loop thread didn't start rc=%d", rc); |
259 } |
264 } |
260 |
265 |
|
266 rc = piThreadCreate(my_server_loop); |
|
267 if (rc) { |
|
268 fprintf(stderr, "my_server_loop thread didn't start rc=%d\n", rc); |
|
269 syslog(LOG_NOTICE, "my_server_loop thread didn't start rc=%d", rc); |
|
270 } |
|
271 |
261 snprintf(buf, 1023, "tempA,coolerA,tempB,coolerB"); |
272 snprintf(buf, 1023, "tempA,coolerA,tempB,coolerB"); |
262 logger((char *)"thermferm.log", (char *)"thermferm", buf); |
273 logger((char *)"thermferm.log", (char *)"thermferm", buf); |
263 |
274 |
264 do { |
275 do { |
265 lcdupdate = FALSE; |
276 lcdupdate = FALSE; |