diff -r 15dc572a7fcb -r e03d729aecb8 main/co2meter.c --- a/main/co2meter.c Tue Oct 03 17:24:06 2023 +0200 +++ b/main/co2meter.c Tue Oct 03 19:43:22 2023 +0200 @@ -29,7 +29,7 @@ extern bool _wifi_ScanDone; extern int8_t _wifi_RSSI; extern int count_pub; ///< Published MQTT messages in transit -extern uint32_t AlarmTimer; ///< Alarm timer +extern uint32_t LoopTimer; ///< Loop timer extern uint32_t err_connect; ///< Connect error counter char hostname[32]; @@ -171,7 +171,7 @@ Main_Loop1 = ML1_CONNECT; request_ds18b20(); request_adc(); - AlarmTimer = 30 * 100; + LoopTimer = MAINLOOP_TIMER; if (! ready_WiFi()) { /* If WiFi was lost, try a new connection */ ESP_LOGI(TAG, "Try WiFi restore"); request_WiFi(); @@ -315,15 +315,9 @@ case ML1_DONE: /* Wait here until the timer resets the loop */ - if (AlarmTimer == 0) { - Main_Loop1 = ML1_INIT; - ESP_LOGI(TAG, "Loop => ML1_INIT"); - } break; } vTaskDelay(10 / portTICK_PERIOD_MS); - if (AlarmTimer > 0) - AlarmTimer--; } Main_Loop1 = ML1_INIT;