diff options
| author | Selene ToyKeeper | 2020-08-23 11:43:11 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-08-23 11:43:11 -0600 |
| commit | 8323c1823f4e1dbb7b78142a082bfbf7cdae2456 (patch) | |
| tree | 12e614313174b0f60c9cbab7b41dd330e8873962 /spaghetti-monster/fsm-standby.c | |
| parent | merged Emisar D4v2.5 build targets with Noctigon KR4 build targets (diff) | |
| download | anduril-8323c1823f4e1dbb7b78142a082bfbf7cdae2456.tar.gz anduril-8323c1823f4e1dbb7b78142a082bfbf7cdae2456.tar.bz2 anduril-8323c1823f4e1dbb7b78142a082bfbf7cdae2456.zip | |
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)
Diffstat (limited to 'spaghetti-monster/fsm-standby.c')
| -rw-r--r-- | spaghetti-monster/fsm-standby.c | 8 |
1 files changed, 4 insertions, 4 deletions
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 |
