thermferm/thermferm.c

changeset 164
f16def8472ba
parent 160
87bfa951ffc2
child 165
e97829d0f8f9
equal deleted inserted replaced
163:3d813570a5e3 164:f16def8472ba
50 extern int lcdHandle; 50 extern int lcdHandle;
51 extern unsigned char lcdbuf[MAX_LCDS][20][4]; 51 extern unsigned char lcdbuf[MAX_LCDS][20][4];
52 #endif 52 #endif
53 int lcdupdate; 53 int lcdupdate;
54 #ifndef HAVE_WIRINGPI_H 54 #ifndef HAVE_WIRINGPI_H
55 pthread_t threads[3]; 55 pthread_t threads[4];
56 #endif 56 #endif
57 extern const char UNITMODE[5][8]; 57 extern const char UNITMODE[5][8];
58 58
59 59
60 int server(void); 60 int server(void);
253 fprintf(stdout, "Detected %d new devices\n", rc); 253 fprintf(stdout, "Detected %d new devices\n", rc);
254 wrconfig(); 254 wrconfig();
255 } 255 }
256 256
257 #ifdef HAVE_WIRINGPI_H 257 #ifdef HAVE_WIRINGPI_H
258 rc = piThreadCreate(my_devices_loop);
259 #else
260 rc = pthread_create(&threads[t], NULL, my_devices_loop, (void *)t );
261 #endif
262 if (rc) {
263 fprintf(stderr, "my_devices_loop thread didn't start rc=%d\n", rc);
264 syslog(LOG_NOTICE, "my_devices_loop thread didn't start rc=%d", rc);
265 #ifndef HAVE_WIRINGPI_H
266 } else {
267 t++;
268 #endif
269 }
270
271 #ifdef HAVE_WIRINGPI_H
258 rc = piThreadCreate(my_sensors_loop); 272 rc = piThreadCreate(my_sensors_loop);
259 #else 273 #else
260 rc = pthread_create(&threads[t], NULL, my_sensors_loop, (void *)t ); 274 rc = pthread_create(&threads[t], NULL, my_sensors_loop, (void *)t );
261 #endif 275 #endif
262 if (rc) { 276 if (rc) {

mercurial