From 8323c1823f4e1dbb7b78142a082bfbf7cdae2456 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Sun, 23 Aug 2020 11:43:11 -0600 Subject: attempt to fix laggy voltage readings right after waking, on FW3A (with no sleep ticks, the voltage value never gets reset to the raw value, and instead only goes through the lowpass filter) (this fix is not yet tested... will test before uploading) (also carries a risk of messing up thermal values after being asleep, so that needs to be tested too) --- spaghetti-monster/fsm-standby.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spaghetti-monster/fsm-standby.c') diff --git a/spaghetti-monster/fsm-standby.c b/spaghetti-monster/fsm-standby.c index b002b91..c450bca 100644 --- a/spaghetti-monster/fsm-standby.c +++ b/spaghetti-monster/fsm-standby.c @@ -73,6 +73,7 @@ void sleep_until_eswitch_pressed() go_to_standby = 0; } if (irq_adc) { // ADC done measuring + adc_reset = 1; // don't lowpass while asleep adc_deferred_enable = 1; adc_deferred(); //ADC_off(); // takes care of itself @@ -84,10 +85,9 @@ void sleep_until_eswitch_pressed() } #endif - #ifdef USE_THERMAL_REGULATION - // forget what the temperature was last time we were on - reset_thermal_history = 1; - #endif + // don't lowpass immediately after waking + // also, reset thermal history + adc_reset = 2; // go back to normal running mode // PCINT not needed any more, and can cause problems if on -- cgit v1.2.3