PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2 > Android On TP2
Register Community Search

Notices


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-18-2010, 04:15 PM
Unknownforce's Avatar
PPCGeeks Regular
Offline
Pocket PC: HTC Evo 3D™
Carrier: Sprint
 
Join Date: Nov 2008
Posts: 234
Reputation: 545
Unknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuffUnknownforce knows their stuff
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Battery Meter and Temp reading "Fix" (workaround) (6/22 Update)

Just thought I'd share this here...

First and Foremost. This is NOT supported by the Devs... NOR am I a Dev... This is simply a modification of the code that generates the zImage file. (specifically the file htc_battery_smem.c)

Secondly... It's not dead accurate, it's using some of the calculations from the raphael's battery calculations... I have been told by one of the devs that the rhodium calculates battery life much differently, so I will say that this isn't supposed to be a REAL fix, just a temporary workaround.

OK, now that all that is out of the way... here's somewhat of a "fix" for the Battery meter for the SPRINT CDMA TP2 RHODIUM (At least that's all I've tested it on, I have heard that it also works with the Tilt 2 and other "rhodium" devices, but I can't confirm that)

It's the same zImage as all the others with just a single modified source file compiled in. So all you have to do is copy it over the zImage file you currently have and run android like normal.

6/4 UPDATE

As you may have noticed... when you plug your phone in the battery meter jumps WAY up... well I have done a slight modification to the code to have it show something a Little more accurate... (only slight testing done)

Basically what I did was make it check to see if it's charging, if it is, it does less of a calculation based on the mV reading...

It's not perfect, but it's much closer to accurate when charging now, And what I did was make it so that it's a few percent HIGHER than the actual reading, so hopefully (and I don't know for certain) it will think it's at 100% when it's more like 95 ish then it will stop charging the battery and it won't keep charging and possibly do damage... as I said, I've only done some slight testing with this... but I figured I'd post it and get some feedback... My next thing is to figure out how to stabilize the battery meter so that it doesn't fluctuate as much, As an example, the percentage should never go UP when the phone is not charging, and it does... and also when you're actually using the phone for something that's got a drain on the battery, the percentage drops a lot because the mV reading drops when it's under load, So I have to try to figure out how to add in some calculation to incorporate current load so that it doesn't drop dramatically when you're online or something...

But back to the fix at hand here... You'll notice that at first when you plug it in, the % drops a bit, this is because the mV reading does not increase immediately, give it a minute or so and you will notice it start to climb back up as the mV reading increases. The inverse is also the same, in that when you unplug it AFTER charging for a bit, the % will spike for a bit, the mV reading will start to drop and it will stabilize in a minute or so.

6/22 UPDATE

I added a tiny bit of stabilization code. It's not much, and it isn't changing any calculations, so no more "real" accuracy, but just more to stabilize the battery value when it's under different loads. What I did was give it a place to store a "previous" value, then compare it to the "current" value, and if it's more than 1 % different, stick with the previous value, but if it's more than 10% different, use the current value. (This is necessary for bootup and for charging times when it changes so dramatically that the previous value will always be used because it's more than 1% all the time)

This should hopefully stabilize it a little further, but might need to be tweaked a bit, consider this a "BETA" of this code. I'm probably going to incorporate a little more math into this, because this is quite basic right now, but perhaps averaging values and pulling a value using both the previous and current values... But I haven't the time to sit down and really think about this right now...

I have left the 6/17 up just in case it works better.

The next thing I'm going to do is to make it never INCREASE in percentage if the battery isn't charging, this is easy to do, but I am busy right now, and this is all I could come up with for now.

As with the last change, I also made the change apply to all devices (not just the rhodium) but I don't know that it's a problem on other devices, but figured it wouldn't hurt to add it as most people here are using the rhodium anyways...

I will gladly share the code if anyone wants to take a peek.

The zImage includes all zImage updates located here including the ones from 6/14/10

Enjoy!
Attached Files
File Type: zip modules-zimage-061710.zip (8.59 MB, 107 views) Click for barcode!
File Type: zip modules-zimage-062210.zip (8.59 MB, 365 views) Click for barcode!
__________________

Phone: Sprint HTC EVO 3D
ROM: Synergy Nightly with Own Mods
"If you have the stereo on, why would you turn up the volume on the TV?" 'Cause I like to party

Last edited by Unknownforce; 06-22-2010 at 05:02 PM.
Reply With Quote
This post has been thanked 22 times.
 

  PPCGeeks > Windows Mobile > WM HTC Devices > HTC Touch Pro 2 > Android On TP2


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 01:48 AM.


Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com