thermferm/sensors.c

changeset 66
805f1d285acd
parent 51
a03b6dac5398
child 74
879bd09e2b96
equal deleted inserted replaced
65:a08a1fce439e 66:805f1d285acd
20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 20 * Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 *****************************************************************************/ 21 *****************************************************************************/
22 22
23 #include "thermferm.h" 23 #include "thermferm.h"
24 24
25 #ifdef HAVE_WIRINGPI_H
26
27 25
28 extern bool debug; 26 extern bool debug;
29 extern sys_config Config; 27 extern sys_config Config;
30 extern int my_shutdown; 28 extern int my_shutdown;
31 29
32 30
33 31 #ifdef HAVE_WIRINGPI_H
34 PI_THREAD (my_sensors_loop) 32 PI_THREAD (my_sensors_loop)
33 #else
34 int my_sensors_loop(void)
35 #endif
35 { 36 {
36 w1_therm *tmp1, *old1; 37 w1_therm *tmp1, *old1;
37 char *device, line[60], *p = NULL; 38 char *device, line[60], *p = NULL;
38 FILE *fp; 39 FILE *fp;
39 int temp, rc, deviation; 40 int temp, rc, deviation;
44 45
45 /* 46 /*
46 * Loop forever until the external shutdown variable is set. 47 * Loop forever until the external shutdown variable is set.
47 */ 48 */
48 for (;;) { 49 for (;;) {
50
49 /* 51 /*
50 * Here send our 1-wire sensors values 52 * Here send our 1-wire sensors values
51 */ 53 */
52 for (tmp1 = Config.w1therms; tmp1; tmp1 = old1) { 54 for (tmp1 = Config.w1therms; tmp1; tmp1 = old1) {
53 old1 = tmp1->next; 55 old1 = tmp1->next;
129 } 131 }
130 } 132 }
131 133
132 134
133 135
134 #endif

mercurial