main/co2meter.c

changeset 51
5035385299f6
parent 50
aae0056bc20b
child 52
90a36619b07b
--- a/main/co2meter.c	Thu Apr 02 11:45:36 2020 +0200
+++ b/main/co2meter.c	Sun Apr 05 19:17:17 2020 +0200
@@ -27,7 +27,7 @@
 extern WIFI_State			*wifi_state;			///< WiFi state
 extern EventGroupHandle_t		xEventGroupUser;
 extern int				count_pub;			///< Published MQTT messages in transit
-
+extern uint32_t				AlarmTimer;			///< Alarm timer
 
 
 
@@ -156,6 +156,7 @@
 		    Main_Loop1 = ML1_CONNECT;
 		    request_ds18b20();
 		    request_adc();
+		    AlarmTimer = 30;
 		    if (! ready_WiFi()) { /* If WiFi was lost, try a new connection */
 			ESP_LOGI(TAG, "Try WiFi restore");
 			request_WiFi();
@@ -269,6 +270,7 @@
 
 		case ML1_DONE:
 		    /* Wait here until the timer resets the loop */
+		    AlarmTimer = 0;
 		    break;
 	    }
 	    vTaskDelay(10 / portTICK_PERIOD_MS);

mercurial