summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iriver/h300/powermgmt-h300.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-08-17 20:47:24 +0000
committerJens Arnold <amiconn@rockbox.org>2007-08-17 20:47:24 +0000
commitbfa1adcd06eca3b64f6d71b2231db88cd86ef902 (patch)
treeee53b3a672aed7305e39e72c151928a83bce4e13 /firmware/target/coldfire/iriver/h300/powermgmt-h300.c
parent98a3789071caac4b7e64f1cc0f5969ecd530cc5c (diff)
H300: Read battery voltage with 10bit precision.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14379 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iriver/h300/powermgmt-h300.c')
-rw-r--r--firmware/target/coldfire/iriver/h300/powermgmt-h300.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/target/coldfire/iriver/h300/powermgmt-h300.c b/firmware/target/coldfire/iriver/h300/powermgmt-h300.c
index b2d844075e..1bf1de59d9 100644
--- a/firmware/target/coldfire/iriver/h300/powermgmt-h300.c
+++ b/firmware/target/coldfire/iriver/h300/powermgmt-h300.c
@@ -48,11 +48,11 @@ const unsigned short percent_to_volt_charge[11] =
/* FIX: this value is picked at random */
#define BATTERY_SCALE_FACTOR 6000
-/* full-scale ADC readout (2^8) in millivolt */
+/* full-scale ADC readout (2^10) in millivolt */
/* Returns battery voltage from ADC [millivolts] */
unsigned int battery_adc_voltage(void)
{
- return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 8;
+ return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
}