summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-04-08 18:50:29 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-04-08 18:50:29 +0000
commit12a6ef5c18a003c3bd066d8c00dd34544b038114 (patch)
treedbbb02a9036b2d6b4ec0b4bfe9de3dcf81156e81
parentf85b54ce800d7a90895a536cd23070952cb9f24f (diff)
downloadrockbox-12a6ef5c18a003c3bd066d8c00dd34544b038114.zip
rockbox-12a6ef5c18a003c3bd066d8c00dd34544b038114.tar.gz
rockbox-12a6ef5c18a003c3bd066d8c00dd34544b038114.tar.bz2
rockbox-12a6ef5c18a003c3bd066d8c00dd34544b038114.tar.xz
Use a real battery discharge curve for calibration data
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25540 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/powermgmt-as3525.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/firmware/target/arm/as3525/powermgmt-as3525.c b/firmware/target/arm/as3525/powermgmt-as3525.c
index 47e0376..ae65eb5 100644
--- a/firmware/target/arm/as3525/powermgmt-as3525.c
+++ b/firmware/target/arm/as3525/powermgmt-as3525.c
@@ -35,21 +35,29 @@
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
- /* TODO: this is just an initial guess */
- 3400
+ /*
+ * about 10%, calibrated with C240v2 battery profile at
+ * http://www.rockbox.org/wiki/bin/viewfile/Main/SansaRuntime?filename=c240v2_battery_bench_percent.png;rev=1
+ */
+ 3600
};
const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
{
- /* TODO: this is just an initial guess */
3300
};
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
{
- /* TODO: simple uncalibrated curve, linear except for first 10% */
- { 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200 }
+ /*
+ * TODO:
+ * Below table is calibrated for C240v2 according to
+ * http://www.rockbox.org/wiki/bin/viewfile/Main/SansaRuntime?filename=c240v2_battery_bench_percent.png;rev=1
+ * Batteries for other models may have different discharging curves.
+ * OF seems to stop charging at 4150mV, so that's 100% here.
+ */
+ { 3300, 3597, 3674, 3719, 3745, 3776, 3825, 3890, 3954, 4035, 4150 }
};
#if CONFIG_CHARGING