diff options
| author | Selene ToyKeeper | 2018-01-24 18:27:44 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2018-01-24 18:27:44 -0700 |
| commit | 30b13cc13baba55ac1610ad471ca737a6c817683 (patch) | |
| tree | a3893755b1a446b5d93b446eedeaebedd85a2768 /spaghetti-monster/fsm-wdt.c | |
| parent | Made thermal adjustment speed change depending on how far it needs to go. (diff) | |
| download | anduril-30b13cc13baba55ac1610ad471ca737a6c817683.tar.gz anduril-30b13cc13baba55ac1610ad471ca737a6c817683.tar.bz2 anduril-30b13cc13baba55ac1610ad471ca737a6c817683.zip | |
Work around issues related to ADC interrupt auto-triggering itself.
(was firing off 1000 times faster than desired, causing several issues)
(now only executes when explicitly requested by the WDT)
Diffstat (limited to 'spaghetti-monster/fsm-wdt.c')
| -rw-r--r-- | spaghetti-monster/fsm-wdt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spaghetti-monster/fsm-wdt.c b/spaghetti-monster/fsm-wdt.c index 777bef0..ff96ffb 100644 --- a/spaghetti-monster/fsm-wdt.c +++ b/spaghetti-monster/fsm-wdt.c @@ -107,9 +107,9 @@ ISR(WDT_vect) { // start a new ADC measurement every 4 ticks static uint8_t adc_trigger = 0; adc_trigger ++; - if (adc_trigger > 3) { - adc_trigger = 0; + if (0 == (adc_trigger & 3)) { ADCSRA |= (1 << ADSC) | (1 << ADIE); + adcint_enable = 1; } #endif } |
