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.zip
rockbox-7ade14776f25fae3121aed0d6291b089f4e00363.tar.gz
rockbox-7ade14776f25fae3121aed0d6291b089f4e00363.tar.bz2
rockbox-7ade14776f25fae3121aed0d6291b089f4e00363.tar.xz
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 4ae613a..531f92d 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -304,6 +304,7 @@ Rhino Banga
Paul Jones
Michael Giacomelli
Alex Wenger
+Andree Buschmann
The libmad team
The wavpack team
The ffmpeg team
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 3793578..edf7f2d 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -70,8 +70,6 @@
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING
-#define BATTERY_CAPACITY_DEFAULT 1300 /* default battery capacity */
-
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5022 */
@@ -81,12 +79,13 @@
#define CONFIG_I2C I2C_PP5020
/* Type of mobile power */
-#define CONFIG_BATTERY BATT_LIPOL1300
-#define BATTERY_CAPACITY_MIN 1300 /* min. capacity selectable */
-#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
-#define BATTERY_CAPACITY_INC 50 /* capacity increment */
-#define BATTERY_TYPES_COUNT 1 /* only one type */
-#define BATTERY_SCALE_FACTOR 5865
+#define CONFIG_BATTERY BATT_LIION300
+#define BATTERY_CAPACITY_DEFAULT 300 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 200 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 600 /* max. capacity selectable */
+#define BATTERY_CAPACITY_INC 20 /* capacity increment */
+#define BATTERY_TYPES_COUNT 1 /* only one type */
+#define BATTERY_SCALE_FACTOR 5840
/* Hardware controlled charging? FIXME */
//#define CONFIG_CHARGING CHARGING_SIMPLE
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index e954859..419a491 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -8,6 +8,9 @@
/* For Rolo and boot loader */
#define MODEL_NUMBER 5
+/* For battery type (30GB by default, undefine here to use 60/80GB model) */
+#define CONFIG_BATTERY_IPOD_VIDEO_30GB
+
/* define this if you have recording possibility */
#define HAVE_RECORDING
@@ -70,8 +73,6 @@
/* We can fade the backlight by using PWM */
#define HAVE_BACKLIGHT_PWM_FADING
-#define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */
-
#ifndef SIMULATOR
/* Define this if you have a PortalPlayer PP5022 */
@@ -81,12 +82,23 @@
#define CONFIG_I2C I2C_PP5020
/* Type of mobile power */
-#define CONFIG_BATTERY BATT_LIPOL1300
-#define BATTERY_CAPACITY_MIN 400 /* min. capacity selectable */
-#define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */
-#define BATTERY_CAPACITY_INC 50 /* capacity increment */
-#define BATTERY_TYPES_COUNT 1 /* only one type */
-#define BATTERY_SCALE_FACTOR 5865
+#if (MEM==32) /* this is the 30GB-model */
+# define CONFIG_BATTERY BATT_LIION400
+# define BATTERY_CAPACITY_DEFAULT 400 /* default battery capacity for the 30GB model */
+# define BATTERY_CAPACITY_MIN 300 /* min. capacity selectable */
+# define BATTERY_CAPACITY_MAX 800 /* max. capacity selectable */
+# define BATTERY_CAPACITY_INC 50 /* capacity increment */
+# define BATTERY_TYPES_COUNT 1 /* only one type */
+# define BATTERY_SCALE_FACTOR 5865
+#else /* these are the 60/80GB-models */
+# define CONFIG_BATTERY BATT_LIION400 /* FIXME: we assume to have same discharge behaviour as 30GB iPOD */
+# define BATTERY_CAPACITY_DEFAULT 600 /* default battery capacity for the 60/80GB model */
+# define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
+# define BATTERY_CAPACITY_MAX 1000 /* max. capacity selectable */
+# define BATTERY_CAPACITY_INC 50 /* capacity increment */
+# define BATTERY_TYPES_COUNT 1 /* only one type */
+# define BATTERY_SCALE_FACTOR 5865
+#endif
/* Hardware controlled charging with monitoring */
#define CONFIG_CHARGING CHARGING_MONITOR
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 056b985..a47eee1 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -80,6 +80,8 @@
#define BATT_BP009 820 /* iriver H10 5/6Gb - iriver BP009 */
#define BATT_LIION830 830 /* Toshiba Gigabeat Fxx and Xxx series MK11-2740 */
#define BATT_LIION750 750 /* Sansa e200 LiIon 3,7V */
+#define BATT_LIION400 400 /* iPOD 5G/5.5G Video 30GB LiIon 400mAh */
+#define BATT_LIION300 300 /* iPOD nano LiIon 300mAh */
#define BATT_1AA 333 /* iRiver iFP: Alkaline, NiHM */
/* CONFIG_CHARGING */
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index d42cc30..77764b5 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -103,7 +103,19 @@ extern charger_input_state_type charger_input_state;
# define CURRENT_NORMAL 80 /* 16h playback on 1300mAh battery from IriverRuntime wiki page */
# define CURRENT_BACKLIGHT 23 /* FIXME: This needs to be measured, copied from H100 */
# define CURRENT_RECORD 110 /* additional current while recording */
-#else /* Not iriver H1x0, H3x0, nor Archos Ondio */
+#elif defined(IPOD_ARCH) && (MODEL_NUMBER==4) /* iPOD Nano */
+# define CURRENT_NORMAL 35 /* 8.5-9.0h playback out of 300mAh battery from IpodRuntime */
+# define CURRENT_BACKLIGHT 20 /* FIXME: estimation took over from iPOD Video */
+#if defined(HAVE_RECORDING)
+# define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
+#endif
+#elif defined(IPOD_ARCH) && (MODEL_NUMBER==5) /* iPOD Video */
+# define CURRENT_NORMAL 50 /* 8h out of 400mAh battery (30GB) or 11h out of 600mAh (60GB) from IpodRuntime */
+# define CURRENT_BACKLIGHT 20 /* estimation calculated from IpodRuntime measurement */
+#if defined(HAVE_RECORDING)
+# define CURRENT_RECORD 35 /* FIXME: this needs adjusting */
+#endif
+#else /* Not iriver H1x0, H3x0, nor Archos Ondio, nor iPODVideo */
# define CURRENT_NORMAL 145 /* usual current in mA when using the AJB including some disk/backlight/... activity */
# define CURRENT_BACKLIGHT 30 /* additional current when backlight always on */
#if defined(HAVE_RECORDING)
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 484c97e..88dc3b9 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -175,6 +175,10 @@ static const unsigned int battery_level_dangerous[BATTERY_TYPES_COUNT] =
105, 115
#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver H1x0: LiPolymer */
338
+#elif CONFIG_BATTERY == BATT_LIION300 /* ipod nano */
+ 333
+#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
+ 345
#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */
340
#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */
@@ -198,6 +202,10 @@ static const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
270, 280
#elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver Hxxx */
302
+#elif CONFIG_BATTERY == BATT_LIION300 /* ipod nano */
+ 323
+#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
+ 345
#elif CONFIG_BATTERY == BATT_LIION750 /* Sansa e200 */
330
#elif CONFIG_BATTERY == BATT_LIION830 /* Gigabeat F */
@@ -246,6 +254,12 @@ static const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
#elif CONFIG_BATTERY == BATT_LIION750
/* Sansa Li Ion 750mAH FIXME this is a first linear approach */
{ 330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420 },
+#elif CONFIG_BATTERY == BATT_LIION400 /* iPOD Video 30GB */
+ /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */
+ { 345, 367, 371, 375, 379, 383, 387, 393, 401, 410, 418 },
+#elif CONFIG_BATTERY == BATT_LIION300
+ /* measured values */
+ { 323, 362, 370, 373, 375, 378, 383, 389, 395, 403, 416 },
#else /* NiMH */
/* original values were taken directly after charging, but it should show
100% after turning off the device for some hours, too */
@@ -264,6 +278,12 @@ static const unsigned short percent_to_volt_charge[11] =
#if CONFIG_BATTERY == BATT_LIPOL1300
/* values measured over one full charging cycle */
354, 386, 393, 398, 400, 402, 404, 408, 413, 418, 423 /* LiPo */
+#elif CONFIG_BATTERY == BATT_LIION300
+ /* measured values */
+ 323, 362, 370, 373, 375, 378, 383, 389, 395, 403, 416
+#elif CONFIG_BATTERY == BATT_LIION400
+ /* iPOD Video 30GB Li-Ion 400mAh, first approach based upon measurements */
+ 345, 367, 371, 375, 379, 383, 387, 393, 401, 410, 418
#elif CONFIG_BATTERY == BATT_LIION750
/* Sansa Li Ion 750mAH FIXME*/
330, 339, 348, 357, 366, 375, 384, 393, 402, 411, 420