thermferm/thermferm.c

changeset 93
b759f814469d
parent 86
3d7a241329e2
child 104
5e538c4e1ecb
equal deleted inserted replaced
92:116226a8c70a 93:b759f814469d
39 extern int lcdHandle; 39 extern int lcdHandle;
40 extern unsigned char lcdbuf[MAX_LCDS][20][4]; 40 extern unsigned char lcdbuf[MAX_LCDS][20][4];
41 #endif 41 #endif
42 int lcdupdate; 42 int lcdupdate;
43 #ifndef HAVE_WIRINGPI_H 43 #ifndef HAVE_WIRINGPI_H
44 pthread_t threads[2]; 44 pthread_t threads[3];
45 #endif 45 #endif
46 46
47 int server(void); 47 int server(void);
48 void help(void); 48 void help(void);
49 void die(int); 49 void die(int);
265 } else { 265 } else {
266 t++; 266 t++;
267 #endif 267 #endif
268 } 268 }
269 269
270 #ifdef HAVE_WIRINGPI_H
271 rc = piThreadCreate(my_units_loop);
272 #else
273 rc = pthread_create(&threads[t], NULL, my_units_loop, (void *)t );
274 #endif
275 if (rc) {
276 fprintf(stderr, "my_units_loop thread didn't start rc=%d\n", rc);
277 syslog(LOG_NOTICE, "my_units_loop thread didn't start rc=%d", rc);
278 #ifndef HAVE_WIRINGPI_H
279 } else {
280 t++;
281 #endif
282 }
283
270 snprintf(buf, 1023, "tempA,tempB"); 284 snprintf(buf, 1023, "tempA,tempB");
271 logger((char *)"thermferm.log", (char *)"thermferm", buf); 285 logger((char *)"thermferm.log", (char *)"thermferm", buf);
272 286
273 do { 287 do {
274 lcdupdate = FALSE; 288 lcdupdate = FALSE;

mercurial