# HG changeset patch # User Daniel O'Connor # Date 1364821765 -37800 # Node ID 93388163e0378a88f24438fde85cffd5f4af5c44 # Parent 781071a115be88f9bf2daceee38cd307b2f14e75 Fix 'none' mode. diff -r 781071a115be -r 93388163e037 tempctrl.c --- a/tempctrl.c Mon May 11 09:55:51 2009 +0930 +++ b/tempctrl.c Mon Apr 01 23:39:25 2013 +1030 @@ -222,7 +222,7 @@ /* Don't do any logging, just force idle and leave */ if (settings.mode == TC_MODE_NOTHING) { nextstate = 'i'; - goto setstate; + goto skip; } /* Update our temperatures @@ -259,7 +259,7 @@ switch (currstate) { case 'i': /* If we're idle then only heat or cool if the temperate difference is out of the - * hysteresis band + * hysteresis band and the heater/cooler have been off long enough */ if (abs(diff) > settings.hysteresis) { if (diff < 0 && settings.minheatofftime + lastheatoff < t) @@ -311,7 +311,8 @@ else if (settings.mode == TC_MODE_COOL) nextstate = 'c'; - // Keep track of when we last turned things on or off + /* Keep track of when we last turned things on or off */ + skip: switch (nextstate) { case 'c': if (currstate == 'h') @@ -334,21 +335,21 @@ if (nextstate != '-') currstate = nextstate; - + if (settings.mode != TC_MODE_NOTHING) { #if 0 - printf_P(PSTR("T: %10ld, "), t); + printf_P(PSTR("T: %10ld, "), t); #else - ds1307_printtime(PSTR(""), PSTR(": ")); + ds1307_printtime(PSTR(""), PSTR(": ")); #endif - printtemp(PSTR("Tr"), settings.target_temp, PSTR(", ")); - printtemp(PSTR("Fm"), tempt, PSTR(", ")); // Use actual value from sensor - printtemp(PSTR("Fr"), fridge_temp, PSTR(", ")); - printtemp(PSTR("Am"), ambient_temp, PSTR(", ")); - printf_P(PSTR("St: %S, Fl: %S%S\r\n"), state2long(currstate), - forced ? PSTR("F") : PSTR(""), - stale ? PSTR("S") : PSTR("")); + printtemp(PSTR("Tr"), settings.target_temp, PSTR(", ")); + printtemp(PSTR("Fm"), tempt, PSTR(", ")); // Use actual value from sensor + printtemp(PSTR("Fr"), fridge_temp, PSTR(", ")); + printtemp(PSTR("Am"), ambient_temp, PSTR(", ")); + printf_P(PSTR("St: %S, Fl: %S%S\r\n"), state2long(currstate), + forced ? PSTR("F") : PSTR(""), + stale ? PSTR("S") : PSTR("")); + } - setstate: setstate(currstate); }