diff -r 0258107a9e72 -r 13502d0dda65 thermferm/thermferm.c --- a/thermferm/thermferm.c Sat Nov 14 17:00:37 2015 +0100 +++ b/thermferm/thermferm.c Sat Nov 14 23:40:51 2015 +0100 @@ -396,7 +396,6 @@ /* * Handle panel key events */ -#ifdef HAVE_WIRINGPI_H void panel_key_events(int key) { units_list *unit; @@ -799,8 +798,6 @@ break; } } -#endif - @@ -932,11 +929,9 @@ profiles_list *profile; prof_step *step; int row, rc, run = 1, seconds = 0, minutes = 0, temp, deviation; - int run_seconds, run_minutes, run_hours, tot_minutes; + int run_seconds, run_minutes, run_hours, tot_minutes, key; struct tm *tm; -#ifdef HAVE_WIRINGPI_H - int key; -#else +#ifndef HAVE_WIRINGPI_H long t = 0; #endif int current_step, valid_step, time_until_now, previous_fridge_mode; @@ -982,12 +977,18 @@ } #ifdef HAVE_WIRINGPI_H - if ((rc = piThreadCreate(my_panel_loop))) { + rc = piThreadCreate(my_panel_loop) { +#else + rc = pthread_create(&threads[t], NULL, my_panel_loop, (void *)t ); +#endif + if (rc) { fprintf(stderr, "my_panel_loop thread didn't start rc=%d\n", rc); syslog(LOG_NOTICE, "my_panel_loop thread didn't start rc=%d", rc); - } +#ifndef HAVE_WIRINGPI_H + } else { + t++; #endif - + } #ifdef USE_SIMULATOR #ifdef HAVE_WIRINGPI_H @@ -1784,11 +1785,10 @@ } } -#ifdef HAVE_WIRINGPI_H + slcdDummy(slcdHandle); key = keycheck(); if (key != KEY_NONE) panel_key_events(key); -#endif usleep(100000);