[iPAQ] Re: Wrong APM units iPAQ

From: Max Weninger <max.a.t.takefive.co.at>
Date: Tue Sep 11 2001 - 09:56:28 EDT

Hi,

There is a small problem with the apm units in h3600_ts.c I guess.
/proc/apm always prints battery life in sec although
h3600_apm_get_power_status calculate and returns the amount in minutes.

IMHO it was missing to flag the battery life with 0x8000 to mark that
the result is in minutes. A fix would be something like the following.

Index: linux/kernel/drivers/char/h3600_ts.c
===================================================================
RCS file: /cvs/linux/kernel/drivers/char/h3600_ts.c,v
retrieving revision 1.44
diff -r1.44 h3600_ts.c
608c608,609
< *battery_life = 300 * percentage / 100;

---
>                       u_short bl=300 * percentage / 100;
>                         *battery_life = bl|0x8000;
It is really not a big issue but depending programs (such as apm -m)
will create wrong results.
Regards
Max
-- 
_______________________________________________________________
     \                  
    o/\_          DI Max Weninger
   <\__,\         Email (max@takefive.co.at)          
    ">.  |         
     ` .-|        Jakob-Haringer-Str. 8
        . \       A-5020 Salzburg - AUSTRIA
         . \      Tel: +43 662 4579150 - Fax: +43 662 4579156
         .-|      
_________._|____________________________________________________
Received on Tue Sep 11 05:59:30 2001

This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:44:10 EDT