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>