Re: Re: first shoot for smartbattery

liste-9nAOAgdJVo4b1SvskN2V4Q
2005-01-03T17:02:59Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1889 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Salut François,
On Mon, 3 Jan 2005, François Valenduc wrote:
> ...
> however the value for "time to empty" seems more correct.

> results with the AC adapter unplugged:
> current: 64345 mA
> remain: 6327 mA or mWh
> time to empty: 221 minutes
> time to full: 221 minutes
> temperature: 27.4 C
> voltage: 16589 mV
> And with the AC adapter plugged:
> current: 0 mA
> remain: 6330 mA or mWh
> time to empty: 65535 minutes
> time to full: 65535 minutes
> temperature: 27.4 C
> voltage: 16809 mV
> I don't really understand why each time the time to full or to empty are the
> same. I tried it knowing my battery was fully loaded so I should get 0 minute
> for time to full.
I did not look into the source... but usually the times are calculated:
You take the capacity (remain-value) and divide it by the current. As the
ACPI-1.0 spec only asks for a current-value, if you use a
rechargable-battery and if this is in discharging-mode, you see, that they
did only, what the specs asked as a minimum. I am not sure, if the
current-value would not need to be -1, if it is unknown however.
So it is quite clear, that dividing something (especially if this itself
is not zero) by zero will give you an +overflow... with MAX_UINT (65535
for 16bit) is the nearest representable value.

Cheers
hartwig felger

Hartwig Felger informatics

- --
1024D/339FD693 Hartwig Felger <hgfelger-9nAOAgdJVo4b1SvskN2V4Q@public.gmane.org>
Key fingerprint = FB2F 3EE9 345A D55B 6FF2 0EC1 F5B0 684F 339F D693
For the pulic keys, please visit my page.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFB2XrI9bBoTzOf1pMRAgMjAKDbqUvfvroCvKk63ntxTxxSru9H8wCgrlr8
Ro5LxZQc1D5jkA6RSdOiAKI=
=s2U+
-----END PGP SIGNATURE-----