diff options
| author | Selene ToyKeeper | 2019-01-23 19:04:21 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-01-23 19:04:21 -0700 |
| commit | 187ce7a5b7b48e8e1643efb8567e04b7bb2bf2df (patch) | |
| tree | d6b68c6d02eed42b6fd6b9041f712baf40392b30 /spaghetti-monster/fsm-adc.c | |
| parent | Updated README to point at build/flash scripts. (diff) | |
| parent | merged trunk (diff) | |
| download | anduril-187ce7a5b7b48e8e1643efb8567e04b7bb2bf2df.tar.gz anduril-187ce7a5b7b48e8e1643efb8567e04b7bb2bf2df.tar.bz2 anduril-187ce7a5b7b48e8e1643efb8567e04b7bb2bf2df.zip | |
merged past 2 months of updates from fsm branch:
Diffstat (limited to 'spaghetti-monster/fsm-adc.c')
| -rw-r--r-- | spaghetti-monster/fsm-adc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |
