From 3848e14a1ee15845271477622d068b666042a436 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Sat, 18 Jan 2020 09:57:34 +0100 Subject: [PATCH] main: activate 3rd watchdog --- soft/main_pilot_wire_control/main_pilot_wire_control.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soft/main_pilot_wire_control/main_pilot_wire_control.ino b/soft/main_pilot_wire_control/main_pilot_wire_control.ino index e13a27a..c0d729d 100644 --- a/soft/main_pilot_wire_control/main_pilot_wire_control.ino +++ b/soft/main_pilot_wire_control/main_pilot_wire_control.ino @@ -146,6 +146,8 @@ void setup() heaters[ROOM_RICO].callback = room_rico_callback; heaters[BATHROOM].callback = bathroom_callback; + lwdTicker.attach_ms(LWD_TIMEOUT_MS / 2, lwdtcb); + for (i = 0; i < NB_HEATERS; i++) { pinMode(heaters[i].pin, OUTPUT); heater_off(heaters[i].pin); @@ -178,6 +180,8 @@ void loop() static unsigned int counter; static bool led_state = false; + lwdtFeed(); + client.loop(); if (!client.isConnected()) { // if something wrong happens, switch off the heater @@ -192,5 +196,4 @@ void loop() led_on(led_state); } counter++; - lwdtFeed(); }