summaryrefslogtreecommitdiff
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
parent00e2252b3437e1d5d9b99521e3ec578dba5e555b (diff)
downloadrockbox-d11f5a7e5f25f93b8c9f5897cfe810138a50825c.tar.gz
rockbox-d11f5a7e5f25f93b8c9f5897cfe810138a50825c.zip
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
-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 @@
22#ifndef POWERMGMT_TARGET_H 22#ifndef POWERMGMT_TARGET_H
23#define POWERMGMT_TARGET_H 23#define POWERMGMT_TARGET_H
24 24
25#include "config.h"
26
25#if defined(SANSA_CLIP) \ 27#if defined(SANSA_CLIP) \
26 || defined(SANSA_CLIPV2) /* FIXME */ \ 28 || defined(SANSA_CLIPV2) /* FIXME */ \
27 || defined(SANSA_CLIPPLUS) /* FIXME */ 29 || defined(SANSA_CLIPPLUS) /* FIXME */
@@ -32,15 +34,6 @@
32#define BATT_CHG_V CHG_V_4_20V 34#define BATT_CHG_V CHG_V_4_20V
33#define BATT_CHG_I CHG_I_100MA 35#define BATT_CHG_I CHG_I_100MA
34#define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */ 36#define CHARGER_TOTAL_TIMER (6*3600*2) /* about 1.5 * capacity / current */
35#if defined(SANSA_CLIP)
36#define ADC_BATTERY ADC_BVDD
37#else
38/* ADC_CHG_IN seems to represent battery voltage better than ADC_BVDD during
39 * charging (ADC_BVDD is way too high) and appears the same in normal use.
40 * Note that when charging some models do not give an accurate reading but jump
41 * between 2 values. */
42#define ADC_BATTERY ADC_CHG_IN
43#endif
44 37
45#elif defined(SANSA_E200V2) 38#elif defined(SANSA_E200V2)
46 39
@@ -50,7 +43,6 @@
50#define BATT_CHG_V CHG_V_4_20V 43#define BATT_CHG_V CHG_V_4_20V
51#define BATT_CHG_I CHG_I_300MA 44#define BATT_CHG_I CHG_I_300MA
52#define CHARGER_TOTAL_TIMER (4*3600*2) 45#define CHARGER_TOTAL_TIMER (4*3600*2)
53#define ADC_BATTERY ADC_BVDD
54 46
55#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2) /* FIXME */ 47#elif defined(SANSA_FUZE) || defined(SANSA_FUZEV2) /* FIXME */
56 48
@@ -60,7 +52,6 @@
60#define BATT_CHG_V CHG_V_4_20V 52#define BATT_CHG_V CHG_V_4_20V
61#define BATT_CHG_I CHG_I_200MA 53#define BATT_CHG_I CHG_I_200MA
62#define CHARGER_TOTAL_TIMER (4*3600*2) 54#define CHARGER_TOTAL_TIMER (4*3600*2)
63#define ADC_BATTERY ADC_BVDD
64 55
65#elif defined(SANSA_C200V2) 56#elif defined(SANSA_C200V2)
66 57
@@ -70,7 +61,6 @@
70#define BATT_CHG_V CHG_V_4_20V 61#define BATT_CHG_V CHG_V_4_20V
71#define BATT_CHG_I CHG_I_200MA 62#define BATT_CHG_I CHG_I_200MA
72#define CHARGER_TOTAL_TIMER (4*3600*2) 63#define CHARGER_TOTAL_TIMER (4*3600*2)
73#define ADC_BATTERY ADC_BVDD
74 64
75#else 65#else
76#error "Charger settings not defined!" 66#error "Charger settings not defined!"
@@ -85,4 +75,14 @@ void charging_algorithm_close(void);
85 75
86#define BATT_AVE_SAMPLES 32 76#define BATT_AVE_SAMPLES 32
87 77
78#if CONFIG_CPU == AS3525
79#define ADC_BATTERY ADC_BVDD
80#else /* AS3525v2 */
81/* ADC_CHG_IN seems to represent battery voltage better than ADC_BVDD during
82 * charging (ADC_BVDD is way too high) and appears the same in normal use.
83 * Note that when charging some models do not give an accurate reading but jump
84 * between 2 values. */
85#define ADC_BATTERY ADC_CHG_IN
86#endif /* CONFIG_CPU */
87
88#endif /* POWERMGMT_TARGET_H */ 88#endif /* POWERMGMT_TARGET_H */