diff options
| author | Selene ToyKeeper | 2020-01-29 05:08:14 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2020-01-29 05:08:14 -0700 |
| commit | 9c0d1832464e4ee7ee8c4c63092ac4337347483b (patch) | |
| tree | 67eb820b425e7a5e019e7158dda30ebab5e1bbe8 /spaghetti-monster/fsm-wdt.c | |
| parent | fixed too-slow thermal response (was introduced in the irq-refactor branch) (diff) | |
| download | anduril-9c0d1832464e4ee7ee8c4c63092ac4337347483b.tar.gz anduril-9c0d1832464e4ee7ee8c4c63092ac4337347483b.tar.bz2 anduril-9c0d1832464e4ee7ee8c4c63092ac4337347483b.zip | |
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)
Diffstat (limited to '')
| -rw-r--r-- | spaghetti-monster/fsm-wdt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spaghetti-monster/fsm-wdt.c b/spaghetti-monster/fsm-wdt.c index 0c49a75..e9dca3a 100644 --- a/spaghetti-monster/fsm-wdt.c +++ b/spaghetti-monster/fsm-wdt.c @@ -181,9 +181,11 @@ void WDT_inner() { // start a new ADC measurement every 4 ticks adc_trigger ++; if (0 == (adc_trigger & 3)) { + // in case we're in standby mode and auto-retrigger is turned off ADC_start_measurement(); - irq_adc_stable = 0; - adcint_enable = 1; + adc_sample_count = 0; + // allow regulation logic to run + adc_deferred_enable = 1; } #endif } |
