Quote:
Originally Posted by surge
Unknownforce,
Have you looked at Post #37 by sovereignty03?
He lists something to try which looks like it may give more accurate readings since the calculations you are using appear to be from a phone with lower capacity.
|
av_index is used for identifying the proper temperature being pulled from the temperature array listed in htc_battery_smem.h, There are 1347 entries in that array. This is why it says if the av_index is higher than this, than it would cause the battery to freeze because it's trying to pull a value beyond the size of the array.
It has no correlation to the battery capacity.
Trust me if it were that easy, the Devs would have already had it working long ago.
The calculations I am using are very close, but they are just not as accurate as they should be. And there ARE no calculations that keep the battery level STABLE under different discharge/load levels at the current time. In just what little I have gathered from my limited disassembly of the battery.dll, it looks like there are 2 different ways it calculates the battery based on whether or not it's discharging or charging, (which is kind of what I have done in the 6/4 update) and then inside that there's multiple battery percentages it stores... One is a "stabilized" reading, another is a "immediate" reading, and another I believe is used in the stabilizing process, most likely a "previous" percentage used to "average" the battery level... So probably the only thing left to do on this is to just stabilize the load to percentage ratio and give it a condition to NEVER go up in percentage if it's NOT charging. But the current code doesn't seem to take load into consideration very well.