aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-wdt.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2018-01-24 18:27:44 -0700
committerSelene ToyKeeper2018-01-24 18:27:44 -0700
commit30b13cc13baba55ac1610ad471ca737a6c817683 (patch)
treea3893755b1a446b5d93b446eedeaebedd85a2768 /spaghetti-monster/fsm-wdt.c
parentMade thermal adjustment speed change depending on how far it needs to go. (diff)
downloadanduril-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 '')
-rw-r--r--spaghetti-monster/fsm-wdt.c4
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
}