thermferm/thermferm.c

changeset 93
b759f814469d
parent 86
3d7a241329e2
child 104
5e538c4e1ecb
--- 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);
 

mercurial