summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-05 01:28:37 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-05 01:28:37 +0000
commitd11f5a7e5f25f93b8c9f5897cfe810138a50825c (patch)
treec40d84648820e7cab94f930320c399e7dc2ab5f8 /firmware/target
parent00e2252b3437e1d5d9b99521e3ec578dba5e555b (diff)
as3525* : all as3525(v1) use ADC_BVDD for reading battery
all as3525v2 use ADC_CHG_IN because ADC_BVDD is way too high when charging Fuzev2 now displays battery icon correctly when charging git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25815 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/powermgmt-target.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/target/arm/as3525/powermgmt-target.h b/firmware/target/arm/as3525/powermgmt-target.h
index cc7441fe5a..50736b1e56 100644
--- a/firmware/target/arm/as3525/powermgmt-target.h
+++ b/firmware/target/arm/as3525/powermgmt-target.h
@@ -22,6 +22,8 @@
#ifndef POWERMGMT_TARGET_H
#define POWERMGMT_TARGET_H
+#include "config.h"
+
#if defined(SANSA_CLIP) \
|| defined(SANSA_CLIPV2) /* FIXME */ \
|| defined(SANSA_CLIPPLUS) /* FIXME */
@@ -32,15 +34,6 @@
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_100MA
#define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */
-#if defined(SANSA_CLIP)
-#define ADC_BATTERY ADC_BVDD
-#else
-/* ADC_CHG_IN seems to represent battery voltage better than ADC_BVDD during
- * charging (ADC_BVDD is way too high) and appears the same in normal use.
- * Note that when charging some models do not give an accurate reading but jump
- * between 2 values. */
-#define ADC_BATTERY ADC_CHG_IN
-#endif
#elif defined(SANSA_E200V2)
@@ -50,7 +43,6 @@
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_300MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
-#define ADC_BATTERY ADC_BVDD
#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2) /* FIXME */
@@ -60,7 +52,6 @@
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_200MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
-#define ADC_BATTERY ADC_BVDD
#elif defined(SANSA_C200V2)
@@ -70,7 +61,6 @@
#define BATT_CHG_V CHG_V_4_20V
#define BATT_CHG_I CHG_I_200MA
#define CHARGER_TOTAL_TIMER (4*3600*2)
-#define ADC_BATTERY ADC_BVDD
#else
#error "Charger settings not defined!"
@@ -85,4 +75,14 @@ void charging_algorithm_close(void);
#define BATT_AVE_SAMPLES 32
+#if CONFIG_CPU == AS3525
+#define ADC_BATTERY ADC_BVDD
+#else /* AS3525v2 */
+/* ADC_CHG_IN seems to represent battery voltage better than ADC_BVDD during
+ * charging (ADC_BVDD is way too high) and appears the same in normal use.
+ * Note that when charging some models do not give an accurate reading but jump
+ * between 2 values. */
+#define ADC_BATTERY ADC_CHG_IN
+#endif /* CONFIG_CPU */
+
#endif /* POWERMGMT_TARGET_H */