summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/rk27xx/hm60x
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-04-30 22:09:45 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-04-30 22:09:45 +0400
commit58dd21daea4de041024caafe81f32e1653ba2c5b (patch)
treef9e20cf8423b1db8610b134317545e4b0a45250d /firmware/target/arm/rk27xx/hm60x
parenta3e3791342d0622785575495e894eb30460af8b0 (diff)
downloadrockbox-58dd21daea4de041024caafe81f32e1653ba2c5b.tar.gz
rockbox-58dd21daea4de041024caafe81f32e1653ba2c5b.zip
hm60x: Calibrated discharge curve.
Change-Id: I1f2ba69d37931d9ac62479c0e68f8ba251d30819
Diffstat (limited to 'firmware/target/arm/rk27xx/hm60x')
-rw-r--r--firmware/target/arm/rk27xx/hm60x/powermgmt-hm60x.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/firmware/target/arm/rk27xx/hm60x/powermgmt-hm60x.c b/firmware/target/arm/rk27xx/hm60x/powermgmt-hm60x.c
index 6ab761672a..e26321f975 100644
--- a/firmware/target/arm/rk27xx/hm60x/powermgmt-hm60x.c
+++ b/firmware/target/arm/rk27xx/hm60x/powermgmt-hm60x.c
@@ -24,37 +24,36 @@
#include "adc-target.h"
#include "powermgmt.h"
-/* Battery voltage calculation and discharge/charge curves for the Meizu M3.
+/* Battery voltage calculation and discharge/charge curves for the HiFiMAN HM-60x.
Battery voltage is calculated under the assumption that the adc full-scale
readout represents 3.00V and that the battery ADC channel is fed with
exactly half of the battery voltage (through a resistive divider).
- Discharge and charge curves have not been calibrated yet.
+ Charge curve have not been calibrated yet.
*/
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
/* TODO: this is just an initial guess */
- 3400
+ 3350
};
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, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 }
+ /* Calibrated curve */
+ { 3300, 3468, 3521, 3562, 3609, 3644, 3691, 3767, 3837, 3919, 4100 }
};
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
const unsigned short percent_to_volt_charge[11] =
- /* TODO: simple uncalibrated curve, linear except for first 10% */
- { 3300, 3600, 3665, 3730, 3795, 3860, 3925, 3990, 4055, 4120, 4185 };
+ /* TODO: simple copy of discharge curve */
+ { 3300, 3468, 3521, 3562, 3609, 3644, 3691, 3767, 3837, 3919, 4100 }
/* full-scale ADC readout (2^10) in millivolt */
#define BATTERY_SCALE_FACTOR 6000