lkml.org 
[lkml]   [2004]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH]: pbook apm_emu.c fix remaining time when charging
From
Date
On Sun, 2004-10-10 at 06:11, Soeren Sonnenburg wrote:
> Hi,
>
> this should make /proc/apm
>
> a) display the remaining time until the battery is fully charged and
> b) when the system is on AC but the battery is not getting charged 0 is
> displayed as remaining time.
>
> Please comment/apply,
> Soeren

if (amperage < 0) {
+ /* when less than 100mA are used the machine must be on AC and as it is
+ not charging the battery is only slightly self decharging and thus full be definition */
+ if (amperage < 100) {

There must be something wrong in the above...

+ time_units = (charge * 59) / (amperage * -1);
+ else
+ time_units = (charge * 16440) / (amperage * -60);

Can you make sure also that amperage is never 0 ?

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.046 / U:1.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site