summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-11-04 16:11:30 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-05 21:14:40 +0000
commit4bbbf044373605938050f7dc0e680eea38278cd9 (patch)
treeb2d0de256d8d4ea6a7660b4b9d91510e6843bba4
parent4792db413f03c4f4fe486f10037d01d3b457bc45 (diff)
downloadchrome-ec-4bbbf044373605938050f7dc0e680eea38278cd9.tar.gz
Do not try to wake the battery after battery cut-off
When the battery cut-off command is issued with external power present, the battery can end up in one of the following two states: 1. The battery stays responsive but is waiting for the external power to go away. 2. The battery decides to cut itself off right away. In case 1, we are already avoiding charging the battery again, so we're good. However, in case 2, the charge state machine mistakenly thinks the battery is dead and tries to revive it. Fix this by checking if the battery is cut off before starting to revive it. BRANCH=None BUG=chrome-os-partner:33372 TEST=Cut off the battery with external power connected. Wait for a while and then disconnect external power. Check the battery is sure cut off. Repeat for several times. Change-Id: Icf343b168a556a490bc1786802a8a6e230863a28 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/227521 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r--common/charge_state_v2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index e0ab8e5929..2346ddd131 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -592,7 +592,7 @@ void charger_task(void)
/* If the battery is not responsive, try to wake it up. */
if (!(curr.batt.flags & BATT_FLAG_RESPONSIVE)) {
- if (battery_seems_to_be_dead) {
+ if (battery_seems_to_be_dead || battery_is_cut_off()) {
/* It's dead, do nothing */
curr.state = ST_IDLE;
curr.requested_voltage = 0;