summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-10-23 15:20:50 -0700
committerKeith Packard <keithp@keithp.com>2011-10-23 15:20:50 -0700
commit90e738a3379d258a48a7c92f6708040fc39c373a (patch)
treef8613b8bb81c6dd7be72175959bfc8c153a58f72
parentf70553106707e3496d07eecb83f0c0a1acad7f77 (diff)
altos: Fix battery voltage computation.
Full scale is 4.95V, not 3.333V. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/cc1111/ao_battery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cc1111/ao_battery.c b/src/cc1111/ao_battery.c
index 070f682f..b9845fb3 100644
--- a/src/cc1111/ao_battery.c
+++ b/src/cc1111/ao_battery.c
@@ -36,7 +36,7 @@ ao_battery_get(void)
ADCCON3 = ADCCON3_EREF_VDD | ADCCON3_EDIV_512 | BATTERY_PIN;
ao_sleep(DATA_TO_XDATA(&ao_battery_value));
);
- return (uint16_t) ((int32_t) ao_battery_value.v * (int32_t) 3333 >> 15);
+ return (uint16_t) ((int32_t) ao_battery_value.v * (int32_t) 4950 >> 15);
}
static void