From 53e3d47a04c749d6a64cd87881448718feb67b99 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Mon, 13 Oct 2025 21:22:26 +0200 Subject: [PATCH] Add watchdog to turn off relays in a hang Prevents a hang from keeping the heater or pump relays always on, which could cause the thermal fuses to burn or the pump to empty the deposit and then burn as well. --- barista/barista.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/barista/barista.ino b/barista/barista.ino index fa4bd14..be73525 100644 --- a/barista/barista.ino +++ b/barista/barista.ino @@ -3,6 +3,7 @@ #include "ntc.h" #include "pinout.h" +#include enum logic { ON = 1, @@ -326,6 +327,7 @@ void do_output(const struct state *st) void setup() { + wdt_disable(); Serial.begin(9600); Serial.println("Booting"); @@ -342,6 +344,7 @@ void setup() relay(PIN_PUMP, OFF); Serial.println("Ready"); + wdt_enable(WDTO_250MS); } void loop() @@ -351,4 +354,5 @@ void loop() do_output(&g_st); delay(5); + wdt_reset(); }