deadbat-alternate.patch
commit8fa55aac744e8d787492227fd4b21d14528f1735
authorWerner Almesberger <werner@openmoko.org>
Tue, 15 Jul 2008 11:34:09 +0000 (15 12:34 +0100)
committerAndy Green <agreen@localhost.localdomain>
Tue, 15 Jul 2008 11:34:09 +0000 (15 12:34 +0100)
tree92df655959275788627cc255dba6d86cb9a1e95b
parent718426fdc01e8a2e2210fc40bd21e0c7eb0d25e2
deadbat-alternate.patch

When there is no battery or the battery is in its cut-off state, even the
slightest charge (once the capacitors on the battery rail are filled) will
drive the battery voltage up to VB_SYS.

The battery voltage monitor therefore only reports garbage. We work around
this problem by alternating the LED with the charger, so that the battery
only gets charged half of the time. We then measure right at the end of a
LED cycle, i.e., when the battery voltage has had time to return to the
level that really represents the battery state.

(Note: battery voltage drops quickly, so giving it one whole second to
drain is very much on the safe side.)

Signed-off-by: Werner Almesberger <werner@openmoko.org>
board/neo1973/gta02/gta02.c