From 7ad02dbf990552fc0cd9e1e9ca2879d484032856 Mon Sep 17 00:00:00 2001 From: Richard Genoud Date: Sat, 18 Jan 2020 09:48:23 +0100 Subject: [PATCH] kitchen_pilot_wire: activate 3rd watchdog --- .../kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino b/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino index 6067e90..87133d8 100644 --- a/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino +++ b/soft/kitchen/kitchen_pilot_wire_control/kitchen_pilot_wire_control.ino @@ -116,6 +116,8 @@ void setup() heaters[KITCHEN].callback = kitchen_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); @@ -146,6 +148,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 @@ -160,5 +164,4 @@ void loop() led_on(led_state); } counter++; - lwdtFeed(); }