From aa97ec520c079eeb44ab581ecc6e2dd67eecd425 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Thu, 3 Jan 2019 11:03:43 -0700 Subject: removed redundant clock speed lines, updated some comments --- spaghetti-monster/fsm-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spaghetti-monster/fsm-adc.c') diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index 2ec630c..8decd9d 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -51,7 +51,7 @@ inline void ADC_off() { static inline uint8_t calc_voltage_divider(uint16_t value) { // use 9.7 fixed-point to get sufficient precision uint16_t adc_per_volt = ((ADC_44<<7) - (ADC_22<<7)) / (44-22); - // incoming value is 14.2 fixed-point, so shift it 2 bits less + // incoming value is 8.2 fixed-point, so shift it 2 bits less uint8_t result = ((value<<5) / adc_per_volt) + VOLTAGE_FUDGE_FACTOR; return result; } -- cgit v1.2.3