forked from len0rd/rockbox
Samsung YH-925: Don't add anything to adc value while reading it.
OF doesn't do such thing. Values in mV are converted proportionally, so no change to the battery meter. Change-Id: Ic545b0514535e7f17f0379ed02f6bdf515f69ac6
This commit is contained in:
parent
f74edac8c7
commit
228c47be4c
2 changed files with 6 additions and 7 deletions
|
|
@ -64,7 +64,8 @@ unsigned short adc_scan(int channel)
|
|||
adcdata[channel] = (adc_data_1<<2 | adc_data_2);
|
||||
|
||||
#if !(defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) ||\
|
||||
defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920))
|
||||
defined(SAMSUNG_YH820) || defined(SAMSUNG_YH920) ||\
|
||||
defined(SAMSUNG_YH925))
|
||||
/* ADC values read low if PLL is enabled */
|
||||
if(PLL_CONTROL & 0x80000000){
|
||||
adcdata[channel] += 0x14;
|
||||
|
|
|
|||
|
|
@ -24,28 +24,26 @@
|
|||
#include "adc.h"
|
||||
#include "powermgmt.h"
|
||||
|
||||
/* TODO: Not yet calibrated */
|
||||
|
||||
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
|
||||
{
|
||||
3750
|
||||
3659
|
||||
};
|
||||
|
||||
const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
|
||||
{
|
||||
3700
|
||||
3609
|
||||
};
|
||||
|
||||
/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
|
||||
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
|
||||
{
|
||||
{ 3700, 3822, 3880, 3909, 3946, 3976, 4024, 4086, 4141, 4223, 4307 }
|
||||
{ 3609, 3731, 3789, 3818, 3855, 3885, 3933, 3995, 4050, 4132, 4216 }
|
||||
};
|
||||
|
||||
/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
|
||||
const unsigned short percent_to_volt_charge[11] =
|
||||
{
|
||||
3868, 3971, 3988, 3998, 4018, 4036, 4097, 4116, 4165, 4222, 4307
|
||||
3777, 3880, 3897, 3907, 3927, 3945, 4006, 4025, 4074, 4131, 4216
|
||||
};
|
||||
|
||||
#define BATTERY_SCALE_FACTOR 4650
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue