summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2007-07-14 14:46:52 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2007-07-14 14:46:52 +0000
commit7ade14776f25fae3121aed0d6291b089f4e00363 (patch)
tree6a77cc722093d57b1f1438da0206c6b2999de985
parent680afafc23d0426038b2eeb80df9b22e005bedd9 (diff)
downloadrockbox-7ade14776f25fae3121aed0d6291b089f4e00363.tar.gz
rockbox-7ade14776f25fae3121aed0d6291b089f4e00363.zip
Correction for ipod video and nano battery type. FS #7216 by Andree Buschmann
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13885 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--docs/CREDITS1
-rw-r--r--firmware/export/config-ipodnano.h15
-rw-r--r--firmware/export/config-ipodvideo.h28
-rw-r--r--firmware/export/config.h2
-rw-r--r--firmware/export/powermgmt.h14
-rw-r--r--firmware/powermgmt.c20
6 files changed, 63 insertions, 17 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index 4ae613aa07..531f92d225 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -304,6 +304,7 @@ Rhino Banga
304Paul Jones 304Paul Jones
305Michael Giacomelli 305Michael Giacomelli
306Alex Wenger 306Alex Wenger
307Andree Buschmann
307The libmad team 308The libmad team
308The wavpack team 309The wavpack team
309The ffmpeg team 310The ffmpeg team
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 37935786b7..edf7f2dea2 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -70,8 +70,6 @@
70/* We can fade the backlight by using PWM */ 70/* We can fade the backlight by using PWM */
71#define HAVE_BACKLIGHT_PWM_FADING 71#define HAVE_BACKLIGHT_PWM_FADING
72 72
73#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
74
75#ifndef SIMULATOR 73#ifndef SIMULATOR
76 74
77/* Define this if you have a PortalPlayer PP5022 */ 75/* Define this if you have a PortalPlayer PP5022 */
@@ -81,12 +79,13 @@
81#define CONFIG_I2C I2C_PP5020 79#define CONFIG_I2C I2C_PP5020
82 80
83/* Type of mobile power */ 81/* Type of mobile power */
84#define CONFIG_BATTERY BATT_LIPOL1300 82#define CONFIG_BATTERY BATT_LIION300
85#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */ 83#define BATTERY_CAPACITY_DEFAULT 300 /* default battery capacity */
86#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */ 84#define BATTERY_CAPACITY_MIN 200 /* min. capacity selectable */
87#define BATTERY_CAPACITY_INC 50 /* capacity increment */ 85#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
88#define BATTERY_TYPES_COUNT 1 /* only one type */ 86#define BATTERY_CAPACITY_INC 20 /* capacity increment */
89#define BATTERY_SCALE_FACTOR 5865 87#define BATTERY_TYPES_COUNT 1 /* only one type */
88#define BATTERY_SCALE_FACTOR 5840
90 89
91/* Hardware controlled charging? FIXME */ 90/* Hardware controlled charging? FIXME */
92//#define CONFIG_CHARGING CHARGING_SIMPLE 91//#define CONFIG_CHARGING CHARGING_SIMPLE
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index e954859eb0..419a49135f 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -8,6 +8,9 @@
8/* For Rolo and boot loader */ 8/* For Rolo and boot loader */
9#define MODEL_NUMBER 5 9#define MODEL_NUMBER 5
10 10
11/* For battery type (30GB by default, undefine here to use 60/80GB model) */
12#define CONFIG_BATTERY_IPOD_VIDEO_30GB
13
11/* define this if you have recording possibility */ 14/* define this if you have recording possibility */
12#define HAVE_RECORDING 15#define HAVE_RECORDING
13 16
@@ -70,8 +73,6 @@
70/* We can fade the backlight by using PWM */ 73/* We can fade the backlight by using PWM */
71#define HAVE_BACKLIGHT_PWM_FADING 74#define HAVE_BACKLIGHT_PWM_FADING
72 75
73#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */
74
75#ifndef SIMULATOR 76#ifndef SIMULATOR
76 77
77/* Define this if you have a PortalPlayer PP5022 */ 78/* Define this if you have a PortalPlayer PP5022 */
@@ -81,12 +82,23 @@
81#define CONFIG_I2C I2C_PP5020 82#define CONFIG_I2C I2C_PP5020
82 83
83/* Type of mobile power */ 84/* Type of mobile power */
84#define CONFIG_BATTERY BATT_LIPOL1300 85#if (MEM==32) /* this is the 30GB-model */
85#define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */ 86# define CONFIG_BATTERY BATT_LIION400
86#define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */ 87# define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */
87#define BATTERY_CAPACITY_INC 50 /* capacity increment */ 88# define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
88#define BATTERY_TYPES_COUNT 1 /* only one type */ 89# define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */
89#define BATTERY_SCALE_FACTOR 5865 90# define BATTERY_CAPACITY_INC 50 /* capacity increment */
91# define BATTERY_TYPES_COUNT 1 /* only one type */
92# define BATTERY_SCALE_FACTOR 5865
93#else /* these are the 60/80GB-models */
94# define CONFIG_BATTERY BATT_LIION400 /* FIXME: we assume to have same discharge behaviour as 30GB iPOD */
95# define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity for the 60/80GB model */
96# define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
97# define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */
98# define BATTERY_CAPACITY_INC 50 /* capacity increment */
99# define BATTERY_TYPES_COUNT 1 /* only one type */
100# define BATTERY_SCALE_FACTOR 5865
101#endif
90 102
91/* Hardware controlled charging with monitoring */ 103/* Hardware controlled charging with monitoring */
92#define CONFIG_CHARGING CHARGING_MONITOR 104#define CONFIG_CHARGING CHARGING_MONITOR
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 056b9857bc..a47eee1b6a 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -80,6 +80,8 @@
80#define BATT_BP009 820 /* iriver H10 5/6Gb - iriver BP009 */ 80#define BATT_BP009 820 /* iriver H10 5/6Gb - iriver BP009 */
81#define BATT_LIION830 830 /* Toshiba Gigabeat Fxx and Xxx series MK11-2740 */ 81#define BATT_LIION830 830 /* Toshiba Gigabeat Fxx and Xxx series MK11-2740 */
82#define BATT_LIION750 750 /* Sansa e200 LiIon 3,7V */ 82#define BATT_LIION750 750 /* Sansa e200 LiIon 3,7V */
83#define BATT_LIION400 400 /* iPOD 5G/5.5G Video 30GB LiIon 400mAh */
84#define BATT_LIION300 300 /* iPOD nano LiIon 300mAh */
83#define BATT_1AA 333 /* iRiver iFP: Alkaline, NiHM */ 85#define BATT_1AA 333 /* iRiver iFP: Alkaline, NiHM */
84 86
85/* CONFIG_CHARGING */ 87/* CONFIG_CHARGING */
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index d42cc30154..77764b5a31 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -103,7 +103,19 @@ extern charger_input_state_type charger_input_state;
103# define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery from IriverRuntime wiki page */ 103# define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery from IriverRuntime wiki page */
104# define CURRENT_BACKLIGHT 23 /* FIXME: This needs to be measured, copied from H100 */ 104# define CURRENT_BACKLIGHT 23 /* FIXME: This needs to be measured, copied from H100 */
105# define CURRENT_RECORD 110 /* additional current while recording */ 105# define CURRENT_RECORD 110 /* additional current while recording */
106#else /* Not iriver H1x0, H3x0, nor Archos Ondio */ 106#elif defined(IPOD_ARCH) && (MODEL_NUMBER==4) /* iPOD Nano */
107# define CURRENT_NORMAL 35 /* 8.5-9.0h playback out of 300mAh battery from IpodRuntime */
108# define CURRENT_BACKLIGHT 20 /* FIXME: estimation took over from iPOD Video */
109#if defined(HAVE_RECORDING)
110# define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
111#endif
112#elif defined(IPOD_ARCH) && (MODEL_NUMBER==5) /* iPOD Video */
113# define CURRENT_NORMAL 50 /* 8h out of 400mAh battery (30GB) or 11h out of 600mAh (60GB) from IpodRuntime */
114# define CURRENT_BACKLIGHT 20 /* estimation calculated from IpodRuntime measurement */
115#if defined(HAVE_RECORDING)
116# define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
117#endif
118#else /* Not iriver H1x0, H3x0, nor Archos Ondio, nor iPODVideo */
107# define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */ 119# define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */
108# define CURRENT_BACKLIGHT 30 /* additional current when backlight always on */ 120# define CURRENT_BACKLIGHT 30 /* additional current when backlight always on */
109#if defined(HAVE_RECORDING) 121#if defined(HAVE_RECORDING)
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 484c97eda9..88dc3b9473 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -175,6 +175,10 @@ static const unsigned int battery_level_dangerous[BATTERY_TYPES_COUNT] =
175 105, 115 175 105, 115
176#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver H1x0: LiPolymer */ 176#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver H1x0: LiPolymer */
177 338 177 338
178#elif CONFIG_BATTERY == BATT_LIION300 /* ipod nano */
179 333
180#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
181 345
178#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */ 182#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */
179 340 183 340
180#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */ 184#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */
@@ -198,6 +202,10 @@ static const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
198 270, 280 202 270, 280
199#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver Hxxx */ 203#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver Hxxx */
200 302 204 302
205#elif CONFIG_BATTERY == BATT_LIION300 /* ipod nano */
206 323
207#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
208 345
201#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */ 209#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */
202 330 210 330
203#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */ 211#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */
@@ -246,6 +254,12 @@ static const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
246#elif CONFIG_BATTERY == BATT_LIION750 254#elif CONFIG_BATTERY == BATT_LIION750
247 /* Sansa Li Ion 750mAH FIXME this is a first linear approach */ 255 /* Sansa Li Ion 750mAH FIXME this is a first linear approach */
248 { 330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420 }, 256 { 330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420 },
257#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
258 /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */
259 { 345, 367, 371, 375, 379, 383, 387, 393, 401, 410, 418 },
260#elif CONFIG_BATTERY == BATT_LIION300
261 /* measured values */
262 { 323, 362, 370, 373, 375, 378, 383, 389, 395, 403, 416 },
249#else /* NiMH */ 263#else /* NiMH */
250 /* original values were taken directly after charging, but it should show 264 /* original values were taken directly after charging, but it should show
251 100% after turning off the device for some hours, too */ 265 100% after turning off the device for some hours, too */
@@ -264,6 +278,12 @@ static const unsigned short percent_to_volt_charge[11] =
264#if CONFIG_BATTERY == BATT_LIPOL1300 278#if CONFIG_BATTERY == BATT_LIPOL1300
265 /* values measured over one full charging cycle */ 279 /* values measured over one full charging cycle */
266 354, 386, 393, 398, 400, 402, 404, 408, 413, 418, 423 /* LiPo */ 280 354, 386, 393, 398, 400, 402, 404, 408, 413, 418, 423 /* LiPo */
281#elif CONFIG_BATTERY == BATT_LIION300
282 /* measured values */
283 323, 362, 370, 373, 375, 378, 383, 389, 395, 403, 416
284#elif CONFIG_BATTERY == BATT_LIION400
285 /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */
286 345, 367, 371, 375, 379, 383, 387, 393, 401, 410, 418
267#elif CONFIG_BATTERY == BATT_LIION750 287#elif CONFIG_BATTERY == BATT_LIION750
268 /* Sansa Li Ion 750mAH FIXME*/ 288 /* Sansa Li Ion 750mAH FIXME*/
269 330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420 289 330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420