According to your latest equation, here are the values I got which seem off according to the initial header data.
Percent
| Voltage
| Header Voltage
|
100
| 3.915181
| 4.04
|
90
| 3.881735
| 4.00 - 4.04
|
80
| 3.848289
| 3.90 - 4.00
|
70
| 3.814843
| 3.79 - 3.90
|
60
| 3.781397
| 3.74 - 3.79
|
50
| 3,646851
| 3.68 - 3.74
|
40
| 3.714506
| N/A
|
30
| 3.68106
| N/A
|
20
| 3.647614
| N/A
|
is that what you want?
Zefie, don't add the code yet, I just noticed there are a couple more instances of code we need to modify. There are a few methods that set the battery level.
The equation isn't an exact linear expression.. Hense an r^2 value less then 1.. basically i derived an equation based on a curve... I was attempting to find a way to express the values as integers of 1 instead of integers of 10..
Like i said previously.. they are going to be off but it is still better then what we currently have.. the problem is
#define BATT_MAXIMUM 59 /* 4.19V */
#define BATT_FULL 46 /* 4.04V */
#define BATT_SAFE_RECHARGE 43 /* 4.00V */
#define BATT_ALMOST_FULL 34 /* 3.90V */
#define BATT_HIGH 24 /* 3.79V */
#define BATT_MED 20 /* 3.74V */
#define BATT_LOW 15 /* 3.68V */
#define BATT_CRITICAL 10 /* 3.63V */
#define BATT_MINIMUM (-2) /* 3.49V */
#define BATT_OFF (-8) /* 3.40V */
I have no idea what they used to determine those numbers that represent the voltages (59,46,43,34,24,20,15,10) in order to create new states between 50-15 so we didnt have such a sudden drop off
the 60-40 range should be the closest to the accurate values since i took the derivative close to the center (figured it was the most accurate way)... Was just trying to figure out a way to get a more "Accurate" percentage..
TBONE: Make sure you dont mess with the parts in the ADC Charging portion.. Those are important as they are i believe
heh, looks like we already have spica code

#if defined(CONFIG_MACH_SPICA)
bat_vol = (((adc - 2170) * 10 / 7)/100)*100 + 3200;
WTF IS THAT?!?
I can't even begin to attempt to figure out what they are trying to calculate.. consider they have ((())/100)*100 which is redundant cause they cancel each other out