View Single Post
  #1084 (permalink)  
Old 01-23-2012, 07:51 PM
milda25's Avatar
milda25
PPCGeeks Regular
Offline
Location: Czech Republic
 
Join Date: Dec 2011
Posts: 79
Reputation: 5
milda25 is a n00b
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: [TESTING] - NAND OMGB (1.2.3)

Quote:
Originally Posted by [ACL] View Post
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.
Arrrggghh, I wrote about this post (concerning battery life). BTW: what about your battery life? Am I alone with this problem or has someone same problem?
And about GPS - my GPS doesn't see satelites. I tested it in Google Maps and Sygic. GPS finding, but with no success (no signal from universe ) Tried stock radio 4.49.25.91 and latest 4.49.25.95. Is this problem in my hand or is there any bug? Of course, zip from ACL released a few days ago I have installed.
Reply With Quote