From 9c0d1832464e4ee7ee8c4c63092ac4337347483b Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Wed, 29 Jan 2020 05:08:14 -0700 Subject: rewrote ADC code to use a continuous lowpass system on all measurements, to eliminate noise and maybe increase precision (thermal code still needs to be rewritten though) --- spaghetti-monster/fsm-standby.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'spaghetti-monster/fsm-standby.c') diff --git a/spaghetti-monster/fsm-standby.c b/spaghetti-monster/fsm-standby.c index 9398f52..14b6df1 100644 --- a/spaghetti-monster/fsm-standby.c +++ b/spaghetti-monster/fsm-standby.c @@ -73,8 +73,8 @@ void sleep_until_eswitch_pressed() go_to_standby = 0; } if (irq_adc) { // ADC done measuring - adcint_enable = 1; - ADC_inner(); + adc_deferred_enable = 1; + adc_deferred(); //ADC_off(); // takes care of itself //irq_adc = 0; // takes care of itself } @@ -87,6 +87,10 @@ void sleep_until_eswitch_pressed() #ifdef USE_THERMAL_REGULATION // forget what the temperature was last time we were on reset_thermal_history = 1; + // FIXME: not sure if this should be here + // (the intent is to make sure temperature gets measured before + // thermal logic gets executed) + //set_admux_therm(); #endif // go back to normal running mode -- cgit v1.2.3 From 49f1b5ccd2033109814b99ea4650375e8f33a6be Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 16 Mar 2020 03:19:42 -0600 Subject: merged some misc fixes from pakutrai, cleaned up comments, removed unused symbols --- spaghetti-monster/fsm-standby.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'spaghetti-monster/fsm-standby.c') diff --git a/spaghetti-monster/fsm-standby.c b/spaghetti-monster/fsm-standby.c index 14b6df1..b002b91 100644 --- a/spaghetti-monster/fsm-standby.c +++ b/spaghetti-monster/fsm-standby.c @@ -87,10 +87,6 @@ void sleep_until_eswitch_pressed() #ifdef USE_THERMAL_REGULATION // forget what the temperature was last time we were on reset_thermal_history = 1; - // FIXME: not sure if this should be here - // (the intent is to make sure temperature gets measured before - // thermal logic gets executed) - //set_admux_therm(); #endif // go back to normal running mode -- cgit v1.2.3