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.tar.gz
rockbox-12a6ef5c18a003c3bd066d8c00dd34544b038114.zip
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 47e037684a..ae65eb5678 100644
--- a/firmware/target/arm/as3525/powermgmt-as3525.c
+++ b/firmware/target/arm/as3525/powermgmt-as3525.c
@@ -35,21 +35,29 @@
35 35
36const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 36const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
37{ 37{
38 /* TODO: this is just an initial guess */ 38 /*
39 3400 39 * about 10%, calibrated with C240v2 battery profile at
40 * http://www.rockbox.org/wiki/bin/viewfile/Main/SansaRuntime?filename=c240v2_battery_bench_percent.png;rev=1
41 */
42 3600
40}; 43};
41 44
42const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = 45const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
43{ 46{
44 /* TODO: this is just an initial guess */
45 3300 47 3300
46}; 48};
47 49
48/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 50/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
49const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = 51const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
50{ 52{
51 /* TODO: simple uncalibrated curve, linear except for first 10% */ 53 /*
52 { 3300, 3390, 3480, 3570, 3660, 3750, 3840, 3930, 4020, 4110, 4200 } 54 * TODO:
55 * Below table is calibrated for C240v2 according to
56 * http://www.rockbox.org/wiki/bin/viewfile/Main/SansaRuntime?filename=c240v2_battery_bench_percent.png;rev=1
57 * Batteries for other models may have different discharging curves.
58 * OF seems to stop charging at 4150mV, so that's 100% here.
59 */
60 { 3300, 3597, 3674, 3719, 3745, 3776, 3825, 3890, 3954, 4035, 4150 }
53}; 61};
54 62
55#if CONFIG_CHARGING 63#if CONFIG_CHARGING