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.
This commit is contained in:
parent
90ea67cf08
commit
53e3d47a04
@ -3,6 +3,7 @@
|
||||
|
||||
#include "ntc.h"
|
||||
#include "pinout.h"
|
||||
#include <avr/wdt.h>
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user