diff options
author | Tomasz Malesinski <tomal@rockbox.org> | 2006-08-19 17:45:37 +0000 |
---|---|---|
committer | Tomasz Malesinski <tomal@rockbox.org> | 2006-08-19 17:45:37 +0000 |
commit | 2b415eff3f06adaee273bc867e0c25e88f1c031e (patch) | |
tree | ed0d161f8d57b218d4f5c4da581fd74a3c040c9c | |
parent | 12f1a834f2a4d1603784f57bafe03bcdd9dbe2c4 (diff) | |
download | rockbox-2b415eff3f06adaee273bc867e0c25e88f1c031e.tar.gz rockbox-2b415eff3f06adaee273bc867e0c25e88f1c031e.zip |
Iriver iFP7xx battery support (1xAA).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10659 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/config-ifp7xx.h | 17 | ||||
-rw-r--r-- | firmware/powermgmt.c | 7 |
2 files changed, 15 insertions, 9 deletions
diff --git a/firmware/export/config-ifp7xx.h b/firmware/export/config-ifp7xx.h index 4d89099067..cebb319a13 100644 --- a/firmware/export/config-ifp7xx.h +++ b/firmware/export/config-ifp7xx.h | |||
@@ -43,6 +43,8 @@ | |||
43 | 43 | ||
44 | #define HAVE_FLASH_DISK | 44 | #define HAVE_FLASH_DISK |
45 | 45 | ||
46 | #define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */ | ||
47 | |||
46 | #ifndef SIMULATOR | 48 | #ifndef SIMULATOR |
47 | 49 | ||
48 | /* Define this if you have a Philips PNX0101 */ | 50 | /* Define this if you have a Philips PNX0101 */ |
@@ -52,15 +54,12 @@ | |||
52 | #define CONFIG_I2C I2C_PNX0101 | 54 | #define CONFIG_I2C I2C_PNX0101 |
53 | 55 | ||
54 | /* Type of mobile power */ | 56 | /* Type of mobile power */ |
55 | //#define CONFIG_BATTERY BATT_LIPOL1300 | 57 | #define CONFIG_BATTERY BATT_1AA |
56 | 58 | #define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ | |
57 | #define BATTERY_SCALE_FACTOR 16665 /* FIX: this value is picked at random */ | 59 | #define BATTERY_CAPACITY_MAX 2800 /* max. capacity selectable */ |
58 | 60 | #define BATTERY_CAPACITY_INC 50 /* capacity increment */ | |
59 | /* Hardware controlled charging? FIXME */ | 61 | #define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */ |
60 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 62 | #define BATTERY_SCALE_FACTOR 3000 /* TODO: only roughly correct */ |
61 | |||
62 | /* define this if the hardware can be powered off while charging */ | ||
63 | //#define HAVE_POWEROFF_WHILE_CHARGING | ||
64 | 63 | ||
65 | /* The start address index for ROM builds */ | 64 | /* The start address index for ROM builds */ |
66 | #define ROM_START 0x00000000 | 65 | #define ROM_START 0x00000000 |
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 1be361a01d..3dd4c607a2 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -159,6 +159,8 @@ static const unsigned int battery_level_dangerous[BATTERY_TYPES_COUNT] = | |||
159 | 280 | 159 | 280 |
160 | #elif CONFIG_BATTERY == BATT_3AAA /* Ondio */ | 160 | #elif CONFIG_BATTERY == BATT_3AAA /* Ondio */ |
161 | 310, 345 /* alkaline, NiHM */ | 161 | 310, 345 /* alkaline, NiHM */ |
162 | #elif CONFIG_BATTERY == BATT_1AA /* iRiver iFP */ | ||
163 | 105, 115 /* alkaline, NiHM */ | ||
162 | #elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver H1x0 */ | 164 | #elif CONFIG_BATTERY == BATT_LIPOL1300 /* iRiver H1x0 */ |
163 | 339 | 165 | 339 |
164 | #else /* Player/recorder, NiMH */ | 166 | #else /* Player/recorder, NiMH */ |
@@ -182,6 +184,11 @@ static const short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | |||
182 | * for the 1300 mAh stock battery. */ | 184 | * for the 1300 mAh stock battery. */ |
183 | // { 337, 358, 365, 369, 372, 377, 383, 389, 397, 406, 413 } | 185 | // { 337, 358, 365, 369, 372, 377, 383, 389, 397, 406, 413 } |
184 | { 337, 366, 372, 374, 378, 381, 385, 392, 399, 408, 417 } | 186 | { 337, 366, 372, 374, 378, 381, 385, 392, 399, 408, 417 } |
187 | #elif CONFIG_BATTERY == BATT_1AA | ||
188 | /* These values are the same as for 3AAA divided by 3. */ | ||
189 | /* May need recalibration. */ | ||
190 | { 93, 108, 114, 118, 121, 125, 128, 132, 136, 142, 158 }, /* alkaline */ | ||
191 | { 103, 118, 121, 123, 124, 125, 126, 127, 128, 129, 135 } /* NiMH */ | ||
185 | #else /* NiMH */ | 192 | #else /* NiMH */ |
186 | /* original values were taken directly after charging, but it should show | 193 | /* original values were taken directly after charging, but it should show |
187 | 100% after turning off the device for some hours, too */ | 194 | 100% after turning off the device for some hours, too */ |