diff --git a/lambda/display.c b/lambda/display.c index 10dd84e..cb9578d 100644 --- a/lambda/display.c +++ b/lambda/display.c @@ -59,10 +59,10 @@ } void cycleDisplay(void) { - updatePending = true; if (isAlertActive()) { // button pressed during alert cancelAlert(false); + updatePending = true; return; } position++; @@ -72,6 +72,7 @@ if (position == MENU_LAST_TEXT) { lcd_clear(); } + updatePending = true; beep(1, 2, 31); } diff --git a/lambda/rules.c b/lambda/rules.c index 94c0ea0..85a5d19 100644 --- a/lambda/rules.c +++ b/lambda/rules.c @@ -139,7 +139,8 @@ // called about every second void reason(Measurement const meas) { - // apply the rules about every 10 seconds to every 10th measurement + // TODO apply only heating* (not averaged) to every measurement + // and the other (averaged) rules only to every 10th measurement? // if (age % 10 == 0) { size_t rulesSize = sizeof(rules) / sizeof(rules[0]); for (size_t i = 0; i < rulesSize; i++) { @@ -151,7 +152,7 @@ // try to figure out if the fire is building up or burning down by // comparing current measurements with ones that are 3 minutes old. - if (age >= 180) { + if (age >= 179) { dir = DIR_NONE; if ((meas.tempI - rulesMeasPrev.tempI) >= 10 && rulesMeasMax.tempI < 800 && meas.lambda >= 2000) {