Quote:
Originally Posted by [ACL]
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.