930 time_t now, last = (time_t)0; |
927 time_t now, last = (time_t)0; |
931 units_list *unit; |
928 units_list *unit; |
932 profiles_list *profile; |
929 profiles_list *profile; |
933 prof_step *step; |
930 prof_step *step; |
934 int row, rc, run = 1, seconds = 0, minutes = 0, temp, deviation; |
931 int row, rc, run = 1, seconds = 0, minutes = 0, temp, deviation; |
935 int run_seconds, run_minutes, run_hours, tot_minutes; |
932 int run_seconds, run_minutes, run_hours, tot_minutes, key; |
936 struct tm *tm; |
933 struct tm *tm; |
937 #ifdef HAVE_WIRINGPI_H |
934 #ifndef HAVE_WIRINGPI_H |
938 int key; |
|
939 #else |
|
940 long t = 0; |
935 long t = 0; |
941 #endif |
936 #endif |
942 int current_step, valid_step, time_until_now, previous_fridge_mode; |
937 int current_step, valid_step, time_until_now, previous_fridge_mode; |
943 float previous_target_lo, previous_target_hi; |
938 float previous_target_lo, previous_target_hi; |
944 |
939 |
980 t++; |
975 t++; |
981 #endif |
976 #endif |
982 } |
977 } |
983 |
978 |
984 #ifdef HAVE_WIRINGPI_H |
979 #ifdef HAVE_WIRINGPI_H |
985 if ((rc = piThreadCreate(my_panel_loop))) { |
980 rc = piThreadCreate(my_panel_loop) { |
|
981 #else |
|
982 rc = pthread_create(&threads[t], NULL, my_panel_loop, (void *)t ); |
|
983 #endif |
|
984 if (rc) { |
986 fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc); |
985 fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc); |
987 syslog(LOG_NOTICE, "my_panel_loop thread didn't start rc=%d", rc); |
986 syslog(LOG_NOTICE, "my_panel_loop thread didn't start rc=%d", rc); |
|
987 #ifndef HAVE_WIRINGPI_H |
|
988 } else { |
|
989 t++; |
|
990 #endif |
988 } |
991 } |
989 #endif |
|
990 |
|
991 |
992 |
992 #ifdef USE_SIMULATOR |
993 #ifdef USE_SIMULATOR |
993 #ifdef HAVE_WIRINGPI_H |
994 #ifdef HAVE_WIRINGPI_H |
994 rc = piThreadCreate(my_simulator_loop); |
995 rc = piThreadCreate(my_simulator_loop); |
995 #else |
996 #else |