diff options
Diffstat (limited to 'firmware/target/arm/as3525/powermgmt-as3525.c')
-rw-r--r-- | firmware/target/arm/as3525/powermgmt-as3525.c | 18 |
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 | ||
36 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 36 | const 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 | ||
42 | const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = | 45 | const 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 */ |
49 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | 51 | const 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 |