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 > Android On TP2 Development
Register Community Search

Notices


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11 (permalink)  
Old 01-17-2012, 12:42 AM
[ACL]'s Avatar
VIP Member
Offline
Pocket PC: tp2
Carrier: Sprint
Threadstarter
Location: NY
 
Join Date: Feb 2010
Posts: 1,534
Reputation: 6350
[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community[ACL] is a trusted member of the community
Mentioned: 2 Post(s)
Tagged: 0 Thread(s)
Re: [TESTING] - NAND OMGB (1.2.3)

Quote:
Originally Posted by vzihome View Post
Muziling had mentioned to ACL about a battery hack he found, ACL said that he would release it on next build don't know if he did on this build...correct me if I'm wrong!

Sent from my Touch Pro 2 using Tapatalk
Ahh, you are correct. Well the hack was to avoid these nasty div by 0 we used to get in the logs.

Code:
diff --git a/arch/arm/mach-msm/htc_battery_smem.c b/arch/arm/mach-msm/htc_battery_smem.c
index 1d9e750..7967b28 100644
--- a/arch/arm/mach-msm/htc_battery_smem.c
+++ b/arch/arm/mach-msm/htc_battery_smem.c
@@ -1371,7 +1371,12 @@ static int htc_rhod_batt_corr( struct battery_info_reply *buffer )
        
         /* TODO: temp algo is not ok..if someone have the timte -> must look into the driver */
        buffer->batt_tempRAW = ( buffer->batt_tempRAW * 5200 ) / htc_adc_range;
-       av_index = ( buffer->batt_tempRAW * 18 ) / ( 2600 - buffer->batt_tempRAW );
+       /* HACK: This is a giant hack since if batt_tempRAW = 2600 we get a div by 0 */
+       if (buffer->batt_tempRAW < 2600) {
+               av_index = ( buffer->batt_tempRAW * 18 ) / ( 2600 - buffer->batt_tempRAW );
+       } else { 
+               av_index =1347;
+       }
        buffer->batt_tempRAW = htc_battery_temperature_lut( av_index );
        if ( buffer->batt_tempRAW < 250 ) /* fixed til so long we can get constant values - otherwise the algo wouln'T work good */
                buffer->batt_tempRAW = 250;
I'll prioritise this if everyone is getting less and less batt time now.
Reply With Quote
This post has been thanked 2 times.
 

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


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 08:10 AM.


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