thermferm/thermferm.c

changeset 259
b7c967359771
parent 248
870d0be6880d
child 267
a84792cab21c
equal deleted inserted replaced
258:e02393b29733 259:b7c967359771
24 #include "logger.h" 24 #include "logger.h"
25 #include "rdconfig.h" 25 #include "rdconfig.h"
26 #include "devices.h" 26 #include "devices.h"
27 #include "server.h" 27 #include "server.h"
28 #include "thermferm.h" 28 #include "thermferm.h"
29 #include "simulator.h"
29 #include "lcd-pcf8574.h" 30 #include "lcd-pcf8574.h"
30 #include "lcd-buffer.h" 31 #include "lcd-buffer.h"
31 #include "panel.h" 32 #include "panel.h"
32 #include "futil.h" 33 #include "futil.h"
33 #include "xutil.h" 34 #include "xutil.h"
47 profiles_list *current_profile = NULL; 48 profiles_list *current_profile = NULL;
48 float temp_temp = 20.0; 49 float temp_temp = 20.0;
49 #endif 50 #endif
50 51
51 #ifndef HAVE_WIRINGPI_H 52 #ifndef HAVE_WIRINGPI_H
52 pthread_t threads[4]; 53 pthread_t threads[5];
53 #endif 54 #endif
54 extern const char UNITMODE[5][8]; 55 extern const char UNITMODE[5][8];
55 extern const char PROFSTATE[4][6]; 56 extern const char PROFSTATE[4][6];
56 57
57 58
884 #ifdef HAVE_WIRINGPI_H 885 #ifdef HAVE_WIRINGPI_H
885 rc = piThreadCreate(my_panel_loop); 886 rc = piThreadCreate(my_panel_loop);
886 if (rc) { 887 if (rc) {
887 fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc); 888 fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc);
888 syslog(LOG_WARNING, "my_panel_loop thread didn't start rc=%d", rc); 889 syslog(LOG_WARNING, "my_panel_loop thread didn't start rc=%d", rc);
890 }
891 #endif
892
893
894 #ifdef USE_SIMULATOR
895 #ifdef HAVE_WIRINGPI_H
896 rc = piThreadCreate(my_simulator_loop);
897 #else
898 rc = pthread_create(&threads[t], NULL, my_simulator_loop, (void *)t );
899 #endif
900 if (rc) {
901 fprintf(stderr, "my_simulator_loop thread didn't start rc=%d\n", rc);
902 syslog(LOG_WARNING, "my_simulator_loop thread didn't start rc=%d", rc);
903 #ifndef HAVE_WIRINGPI_H
904 } else {
905 t++;
906 #endif
889 } 907 }
890 #endif 908 #endif
891 909
892 /* 910 /*
893 * Initialize units for processing 911 * Initialize units for processing

mercurial