diff -r 6c4c884be155 -r e981d0185485 thermferm/thermferm.c --- a/thermferm/thermferm.c Wed Mar 27 18:59:39 2024 +0100 +++ b/thermferm/thermferm.c Tue Apr 02 15:03:12 2024 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2014-2022 + * Copyright (C) 2014-2024 * * Michiel Broek * @@ -22,15 +22,16 @@ #include "lock.h" #include "rdconfig.h" -#include "devices.h" #include "server.h" #include "thermferm.h" +#include "devices.h" #include "delay.h" #include "simulator.h" #include "lcd-pcf8574.h" #include "lcd-buffer.h" #include "slcd.h" #include "panel.h" +#include "one-wire.h" #include "futil.h" #include "xutil.h" #include "pid.h" @@ -51,6 +52,7 @@ extern int my_panel_state; extern int my_server_state; extern int my_simulator_state; +extern int my_one_wire_state; int setupmenu = MENU_NONE; units_list *current_unit = NULL; /* In panel editor this points to the current unit. */ float temp_temp = 20.0; @@ -1064,6 +1066,14 @@ t++; } + rc = pthread_create(&threads[t], NULL, my_one_wire_loop, (void *)t ); + if (rc) { + fprintf(stderr, "my_one_wire_loop thread didn't start rc=%d\n", rc); + syslog(LOG_NOTICE, "my_one_wire_loop thread didn't start rc=%d", rc); + } else { + t++; + } + #ifdef USE_SIMULATOR rc = pthread_create(&threads[t], NULL, my_simulator_loop, (void *)t ); if (rc) { @@ -1915,9 +1925,9 @@ /* * Note that we don't care if the command server is stopped, this one - * does almost certain keep running but tat doesn't harm. + * does almost certain keep running but that doesn't harm. */ - while ((my_devices_state + my_panel_state + my_simulator_state) > 0) { sleep(1); }; + while ((my_devices_state + my_panel_state + my_simulator_state + my_one_wire_state) > 0) { sleep(1); }; mqtt_disconnect(); stopLCD();