diff -r 116226a8c70a -r b759f814469d thermferm/thermferm.c --- a/thermferm/thermferm.c Fri Jul 04 20:00:19 2014 +0200 +++ b/thermferm/thermferm.c Fri Jul 04 23:37:53 2014 +0200 @@ -41,7 +41,7 @@ #endif int lcdupdate; #ifndef HAVE_WIRINGPI_H -pthread_t threads[2]; +pthread_t threads[3]; #endif int server(void); @@ -267,6 +267,20 @@ #endif } +#ifdef HAVE_WIRINGPI_H + rc = piThreadCreate(my_units_loop); +#else + rc = pthread_create(&threads[t], NULL, my_units_loop, (void *)t ); +#endif + if (rc) { + fprintf(stderr, "my_units_loop thread didn't start rc=%d\n", rc); + syslog(LOG_NOTICE, "my_units_loop thread didn't start rc=%d", rc); +#ifndef HAVE_WIRINGPI_H + } else { + t++; +#endif + } + snprintf(buf, 1023, "tempA,tempB"); logger((char *)"thermferm.log", (char *)"thermferm", buf);