thermferm/thermferm.c

changeset 158
f1b7e2ef90be
parent 156
5fb74d89f571
child 160
87bfa951ffc2
equal deleted inserted replaced
157:259a018758f9 158:f1b7e2ef90be
22 22
23 #include "lock.h" 23 #include "lock.h"
24 #include "logger.h" 24 #include "logger.h"
25 #include "rdconfig.h" 25 #include "rdconfig.h"
26 #include "sensors.h" 26 #include "sensors.h"
27 #include "devices.c"
27 #include "server.h" 28 #include "server.h"
28 #include "thermferm.h" 29 #include "thermferm.h"
29 #include "lcd-pcf8574.h" 30 #include "lcd-pcf8574.h"
30 #include "lcd-buffer.h" 31 #include "lcd-buffer.h"
31 #include "futil.h" 32 #include "futil.h"
243 if (lockprog((char *)"thermferm")) { 244 if (lockprog((char *)"thermferm")) {
244 syslog(LOG_NOTICE, "Can't lock"); 245 syslog(LOG_NOTICE, "Can't lock");
245 return 1; 246 return 1;
246 } 247 }
247 248
249 rc = devices_detect();
250 if (rc) {
251 syslog(LOG_NOTICE, "Detected %d new devices", rc);
252 if (debug)
253 fprintf(stdout, "Detected %d new devices\n", rc);
254 wrconfig();
255 }
256
248 #ifdef HAVE_WIRINGPI_H 257 #ifdef HAVE_WIRINGPI_H
249 rc = piThreadCreate(my_sensors_loop); 258 rc = piThreadCreate(my_sensors_loop);
250 #else 259 #else
251 rc = pthread_create(&threads[t], NULL, my_sensors_loop, (void *)t ); 260 rc = pthread_create(&threads[t], NULL, my_sensors_loop, (void *)t );
252 #endif 261 #endif

mercurial