thermferm/thermferm.c

changeset 164
f16def8472ba
parent 160
87bfa951ffc2
child 165
e97829d0f8f9
--- a/thermferm/thermferm.c	Thu Jul 31 22:15:22 2014 +0200
+++ b/thermferm/thermferm.c	Thu Jul 31 23:39:11 2014 +0200
@@ -52,7 +52,7 @@
 #endif
 int			lcdupdate;
 #ifndef HAVE_WIRINGPI_H
-pthread_t		threads[3];
+pthread_t		threads[4];
 #endif
 extern const char       UNITMODE[5][8];
 
@@ -255,6 +255,20 @@
     }
 
 #ifdef HAVE_WIRINGPI_H
+    rc = piThreadCreate(my_devices_loop);
+#else
+    rc = pthread_create(&threads[t], NULL, my_devices_loop, (void *)t );
+#endif
+    if (rc) {
+	fprintf(stderr, "my_devices_loop thread didn't start rc=%d\n", rc);
+	syslog(LOG_NOTICE, "my_devices_loop thread didn't start rc=%d", rc);
+#ifndef HAVE_WIRINGPI_H
+    } else {
+	t++;
+#endif
+    }
+
+#ifdef HAVE_WIRINGPI_H
     rc = piThreadCreate(my_sensors_loop);
 #else
     rc = pthread_create(&threads[t], NULL, my_sensors_loop, (void *)t );

mercurial