diff options
| author | Selene ToyKeeper | 2020-04-19 03:17:24 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-04-19 03:17:24 -0600 |
| commit | 43eec5d7b84f1ac617519723373850733d3adcb1 (patch) | |
| tree | 8357bbf70ee22d84cb1716a8d0b52a88f32e512f /spaghetti-monster | |
| parent | KR4-noFET: made candle mode vary more since the ramp is stretched out, raised... (diff) | |
| download | anduril-43eec5d7b84f1ac617519723373850733d3adcb1.tar.gz anduril-43eec5d7b84f1ac617519723373850733d3adcb1.tar.bz2 anduril-43eec5d7b84f1ac617519723373850733d3adcb1.zip | |
made thermal response larger when error is large, smaller when error is small
(helps on KR4, but will probably need to add the response magnitude thing to adjust speed per build target)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/fsm-adc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index edf1809..760acc4 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -377,11 +377,17 @@ static inline void ADC_temperature_handler() { if (warning_threshold > 0) { warning_threshold -= offset; } else { // error is big enough; send a warning - warning_threshold = THERM_NEXT_WARNING_THRESHOLD - offset; + //warning_threshold = THERM_NEXT_WARNING_THRESHOLD - offset; // how far above the ceiling? //int16_t howmuch = offset * THERM_RESPONSE_MAGNITUDE / 128; - int16_t howmuch = offset; + //int16_t howmuch = offset; + // increase the amount, except for small values + // 1:1, 2:1, 3:3, 4:5, 6:9, 8:13, 10:17, 40:77 + int16_t howmuch = offset + offset - 3; + if (howmuch < 1) howmuch = 1; + warning_threshold = THERM_NEXT_WARNING_THRESHOLD - (uint8_t)howmuch; + // send a warning emit(EV_temperature_high, howmuch); } |
