From ef1d96b85485000e70ef5423c9494eb91286d3d7 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 26 Mar 2020 03:46:47 -0600 Subject: made thermal regulation use a smaller target window, and prioritize cooling more --- spaghetti-monster/fsm-adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index e7b7feb..edf1809 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -362,7 +362,7 @@ static inline void ADC_temperature_handler() { // (but a diff of 1 C should only send a warning of magnitude 1) // (this also makes it only respond to small errors at the time the error // happened, not after the temperature has stabilized) - for(uint8_t foo=0; foo<5; foo++) { + for(uint8_t foo=0; foo<3; foo++) { if (offset > 0) { offset --; } else if (offset < 0) { @@ -371,8 +371,8 @@ static inline void ADC_temperature_handler() { } // Too hot? - // (if it's too hot and still getting warmer...) - if ((offset > 0) && (diff > 0)) { + // (if it's too hot and not getting cooler...) + if ((offset > 0) && (diff > -1)) { // accumulated error isn't big enough yet to send a warning if (warning_threshold > 0) { warning_threshold -= offset; -- cgit v1.2.3