From 2249f9913058c534fba51fbc6285e49c67bce726 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 24 Aug 2017 03:03:55 -0600 Subject: Don't send underheat warnings when LVP is active. The signals conflict. Also, avoid immediate thermal step-down after battery change. (init array with correctly-scaled values) --- spaghetti-monster/fsm-adc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spaghetti-monster/fsm-adc.c') diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index b3ae4e9..9a6e2e7 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -148,7 +148,7 @@ ISR(ADC_vect) { for(uint8_t i=0; i> THERM_DIFF_ATTENUATION; if (howmuch < 1) howmuch = 1; - // try to send out a warning - emit(EV_temperature_low, howmuch); + // try to send out a warning (unless voltage is low) + // (LVP and underheat warnings fight each other) + if (voltage > VOLTAGE_LOW) + emit(EV_temperature_low, howmuch); // reset counters temperature_timer = TEMPERATURE_TIMER_START; underheat_lowpass = 0; -- cgit v1.2.3