From e9e65c8e8ac8b94745ab1c1ed3567bf9a07e3ff4 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 31 Jul 2020 20:53:12 -0600 Subject: added a voltage calibration / correction function, 7C from battcheck to configure --- spaghetti-monster/fsm-adc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spaghetti-monster/fsm-adc.h') 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 -- cgit v1.2.3