projects
/
fw
/
altos
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f705531
)
altos: Fix battery voltage computation.
author
Keith Packard
<keithp@keithp.com>
Sun, 23 Oct 2011 22:20:50 +0000
(15:20 -0700)
committer
Keith Packard
<keithp@keithp.com>
Sun, 23 Oct 2011 22:20:50 +0000
(15:20 -0700)
Full scale is 4.95V, not 3.333V.
Signed-off-by: Keith Packard <keithp@keithp.com>
src/cc1111/ao_battery.c
patch
|
blob
|
history
diff --git
a/src/cc1111/ao_battery.c
b/src/cc1111/ao_battery.c
index 070f682fa60ded378db1b6f646b0a2caf14baae4..b9845fb38612cde07a071bb6e6e9ac1d8e46734f 100644
(file)
--- 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