D2: Update the battery discharge curve to observed values, and add a crude runtime estimation (this is based on playback from SD card, other usage will vary).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21754 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rob Purchase 2009-07-10 19:09:38 +00:00
parent 755de6a3de
commit d633a9fbee
2 changed files with 12 additions and 7 deletions

View file

@ -135,6 +135,11 @@
/* Hardware controlled charging */ /* Hardware controlled charging */
#define CONFIG_CHARGING CHARGING_SIMPLE #define CONFIG_CHARGING CHARGING_SIMPLE
/* Define current usage levels. */
#define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */
#define CURRENT_BACKLIGHT 30 /* TBD */
#define CURRENT_RECORD 0 /* no recording yet */
#ifndef SIMULATOR #ifndef SIMULATOR
/* Define this if you have a TCC7801 */ /* Define this if you have a TCC7801 */
#define CONFIG_CPU TCC7801 #define CONFIG_CPU TCC7801

View file

@ -29,29 +29,29 @@ unsigned short current_voltage = 3910;
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{ {
/* FIXME: calibrate value */
3380 3380
}; };
const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
{ {
/* FIXME: calibrate value */
3300 3300
}; };
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ /* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
{ {
/* FIXME: calibrate values. Table is "inherited" from iPod-PCF / H100 */ /* Standard D2 internal battery */
{ 3370, 3650, 3700, 3740, 3780, 3820, 3870, 3930, 4000, 4080, 4160 } { 3370, 3690, 3750, 3775, 3790, 3820, 3880, 3940, 3980, 4090, 4170 }
/* TODO: DIY replacements eg. Nokia BP-4L ? */
}; };
#if CONFIG_CHARGING #if CONFIG_CHARGING
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ /* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
const unsigned short percent_to_volt_charge[11] = const unsigned short percent_to_volt_charge[11] =
{ {
/* FIXME: calibrate values. Table is "inherited" from iPod-PCF / H100 */ /* FIXME: voltages seem to be offset during charging (eg. 4500+) */
3370, 3650, 3700, 3740, 3780, 3820, 3870, 3930, 4000, 4080, 4160 3370, 3690, 3750, 3775, 3790, 3820, 3880, 3940, 3980, 4090, 4170
}; };
#endif /* CONFIG_CHARGING */ #endif /* CONFIG_CHARGING */