summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/powermgmt-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-11-14 21:45:25 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-11-14 21:45:25 +0000
commit9e4299f6f09707fcde3aef7dd9ab3c4e6b843ce1 (patch)
treecd92d82ee8a111e253b1b7b90a32f1392dd13f38 /firmware/target/arm/imx233/powermgmt-imx233.c
parent4359b40cf1aa352abfc724f89161e4cd8ed8888c (diff)
imx233: implement battery reading using power register (automatically updated & scaled by lradc delay)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30988 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/powermgmt-imx233.c')
-rw-r--r--firmware/target/arm/imx233/powermgmt-imx233.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/powermgmt-imx233.c b/firmware/target/arm/imx233/powermgmt-imx233.c
index 4c7f46e2fb..0f24fa41ff 100644
--- a/firmware/target/arm/imx233/powermgmt-imx233.c
+++ b/firmware/target/arm/imx233/powermgmt-imx233.c
@@ -20,7 +20,7 @@
****************************************************************************/
#include "powermgmt.h"
-#include "adc-target.h"
+#include "power-imx233.h"
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
@@ -49,7 +49,8 @@ const unsigned short percent_to_volt_charge[11] =
/* Returns battery voltage from ADC [millivolts] */
unsigned int battery_adc_voltage(void)
{
- return 4100;
+ /* battery value is in 8mV LSB */
+ return __XTRACT(HW_POWER_BATTMONITOR, BATT_VAL) * 8;
}
void powermgmt_init_target(void)