aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/fsm-adc.c5
-rw-r--r--spaghetti-monster/fsm-adc.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c
index 725902f..c382a8a 100644
--- a/spaghetti-monster/fsm-adc.c
+++ b/spaghetti-monster/fsm-adc.c
@@ -155,8 +155,9 @@ ISR(ADC_vect) {
}
// the next measurement isn't the first
- //adc_sample_count = 1;
- adc_sample_count ++;
+ adc_sample_count = 1;
+ // rollover doesn't really matter
+ //adc_sample_count ++;
}
diff --git a/spaghetti-monster/fsm-adc.h b/spaghetti-monster/fsm-adc.h
index 7acb505..6283b2c 100644
--- a/spaghetti-monster/fsm-adc.h
+++ b/spaghetti-monster/fsm-adc.h
@@ -40,7 +40,7 @@
#endif
volatile uint8_t irq_adc = 0; // ADC interrupt happened?
-uint16_t adc_sample_count = 0; // skip the first sample; it's junk
+uint8_t adc_sample_count = 0; // skip the first sample; it's junk
uint8_t adc_channel = 0; // 0=voltage, 1=temperature
uint16_t adc_raw[2]; // last ADC measurements (0=voltage, 1=temperature)
uint16_t adc_smooth[2]; // lowpassed ADC measurements (0=voltage, 1=temperature)
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.