# HG changeset patch # User Daniel O'Connor # Date 1241564445 -34200 # Node ID c8cd6dd74ca1806cdc0440e6d874d8189f335c93 # Parent a1edf53d904e4ba1a9add3bb24bd30f1586cfd05 Don't call wdt_reset() in the IRQ routine - it makes the WDT useless. Instead only call it as needed when talking to ROMs (which can take a while if you had several). This makes the WDT bite when a problem occurs with the RTC (still not sure what the actual problem is though) diff -r a1edf53d904e -r c8cd6dd74ca1 tempctrl.c --- a/tempctrl.c Wed Jan 21 22:52:40 2009 +1030 +++ b/tempctrl.c Wed May 06 08:30:45 2009 +0930 @@ -162,8 +162,6 @@ */ ISR(TIMER2_COMP_vect) { - wdt_reset(); - now.usec += 8000; /* 1000000 * 1 / F_CPU / 1024 / 125 */ while (now.usec > 1000000) { now.usec -= 1000000; @@ -227,10 +225,16 @@ goto setstate; } - /* Update our temperatures */ + /* Update our temperatures + * Can take a while (800ms each!) so reset the WDT + */ + wdt_reset(); tempt = OWGetTemp(settings.fermenter_ROM); + wdt_reset(); fridge_temp = OWGetTemp(settings.fridge_ROM); + wdt_reset(); ambient_temp = OWGetTemp(settings.ambient_ROM); + wdt_reset(); /* We only care about this one, only update the value we decide on * only if it is valid