--- a/thermferm/thermferm.c Wed May 01 14:38:37 2024 +0200 +++ b/thermferm/thermferm.c Thu May 02 15:49:16 2024 +0200 @@ -62,7 +62,7 @@ extern int my_ws_shutdown; extern int my_simulator_state; #ifdef USE_SIMULATOR -extern int my_simulator_shutdown; +extern int my_simulator_command; #endif extern int my_one_wire_state; extern int my_one_wire_shutdown; @@ -1869,9 +1869,9 @@ my_shutdown = my_reboot = FALSE; my_devices_shutdown = my_panel_shutdown = my_server_shutdown = my_ws_shutdown = my_one_wire_shutdown = 0; my_devices_state = my_panel_state = my_server_state = my_ws_state = my_one_wire_state = 0; - my_simulator_state = 0; + my_simulator_state = THREAD_OFF; #ifdef USE_SIMULATOR - my_simulator_shutdown = 0; + my_simulator_command = THREAD_OFF; #endif if (lockprog((char *)"thermferm")) { syslog(LOG_NOTICE, "Can't lock"); @@ -2026,8 +2026,8 @@ * Stop threads */ #ifdef USE_SIMULATOR - my_simulator_shutdown = 1; - while (my_simulator_state) { mDelay(50); }; + my_simulator_command = THREAD_OFF; + while (my_simulator_state != THREAD_OFF) { mDelay(50); }; #endif my_panel_shutdown = 1; while (my_panel_state) { mDelay(50); };