diff options
| author | Selene ToyKeeper | 2017-08-24 03:03:55 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-08-24 03:03:55 -0600 |
| commit | 2249f9913058c534fba51fbc6285e49c67bce726 (patch) | |
| tree | d5f5580ea70ef0125f84527006a186a7e37eaa25 /spaghetti-monster | |
| parent | Set default brightness to max 7135 level. (diff) | |
| download | anduril-2249f9913058c534fba51fbc6285e49c67bce726.tar.gz anduril-2249f9913058c534fba51fbc6285e49c67bce726.tar.bz2 anduril-2249f9913058c534fba51fbc6285e49c67bce726.zip | |
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)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/fsm-adc.c | 10 |
1 files changed, 5 insertions, 5 deletions
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<NUM_THERMAL_VALUES; i++) temperature_values[i] = temp; for(uint8_t i=0; i<NUM_THERMAL_VALUES_HISTORY; i++) - temperature_history[i] = temp; + temperature_history[i] = temp<<2; temperature = temp; } else { // update our current temperature estimate uint8_t i; @@ -231,13 +231,13 @@ ISR(ADC_vect) { if (underheat_lowpass < UNDERHEAT_LOWPASS_STRENGTH) { underheat_lowpass ++; } else { - // FIXME: don't warn about underheating when voltage is low - // (LVP and underheat warnings fight each other) // how far below the floor? int16_t howmuch = (THERM_FLOOR - projected_temperature) >> 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; |
