From c5ebdd4a04984fc0962810912eb775e6a33f1167 Mon Sep 17 00:00:00 2001 From: Bruce Date: Fri, 2 Dec 2016 17:32:10 +0800 Subject: [PATCH] pyro/snappy: Enable battery learn-mode when battery charging not allowed Follow reef setting. BUG=none BRANCH=none TEST=make buildall Change-Id: I5fb77cce01b3eec865f3491032ad66c05db3b1c3 Signed-off-by: Bruce.Wan Reviewed-on: https://chromium-review.googlesource.com/416031 Commit-Ready: Keith Tzeng Tested-by: Keith Tzeng Reviewed-by: Aaron Durbin --- board/pyro/battery.c | 2 ++ board/snappy/battery.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/board/pyro/battery.c b/board/pyro/battery.c index 87aacfec72..1b816cadd1 100644 --- a/board/pyro/battery.c +++ b/board/pyro/battery.c @@ -232,6 +232,8 @@ int charger_profile_override(struct charge_state_data *curr) int batt_voltage; static int prev_batt_voltage; + charger_discharge_on_ac(!(curr->batt.flags & BATT_FLAG_WANT_CHARGE)); + /* * Determine temperature range. The five ranges are: * < 10C diff --git a/board/snappy/battery.c b/board/snappy/battery.c index ec7543a78d..4abdff5534 100644 --- a/board/snappy/battery.c +++ b/board/snappy/battery.c @@ -160,6 +160,8 @@ int charger_profile_override(struct charge_state_data *curr) int batt_voltage; static int prev_batt_voltage; + charger_discharge_on_ac(!(curr->batt.flags & BATT_FLAG_WANT_CHARGE)); + /* * Determine temperature range. The five ranges are: * < 10C