aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-adc.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-07-31 20:53:12 -0600
committerSelene ToyKeeper2020-07-31 20:53:12 -0600
commite9e65c8e8ac8b94745ab1c1ed3567bf9a07e3ff4 (patch)
tree7990da359a597e9dcfabf5af6b693fb28459c424 /spaghetti-monster/fsm-adc.h
parentfixed bug: sunset timer didn't adjust MCU clock speed at low levels, (diff)
downloadanduril-e9e65c8e8ac8b94745ab1c1ed3567bf9a07e3ff4.tar.gz
anduril-e9e65c8e8ac8b94745ab1c1ed3567bf9a07e3ff4.tar.bz2
anduril-e9e65c8e8ac8b94745ab1c1ed3567bf9a07e3ff4.zip
added a voltage calibration / correction function, 7C from battcheck to configure
Diffstat (limited to 'spaghetti-monster/fsm-adc.h')
-rw-r--r--spaghetti-monster/fsm-adc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-adc.h b/spaghetti-monster/fsm-adc.h
index cc33264..56583bb 100644
--- a/spaghetti-monster/fsm-adc.h
+++ b/spaghetti-monster/fsm-adc.h
@@ -52,6 +52,11 @@ void adc_deferred(); // do the actual ADC-related calculations
static inline void ADC_voltage_handler();
uint8_t voltage = 0;
+#ifdef USE_VOLTAGE_CORRECTION
+// same 0.05V units as fudge factor,
+// but 7 is neutral, and the expected range is from 1 to 13
+uint8_t voltage_correction = 7;
+#endif
#ifdef USE_LVP
void low_voltage();
#endif