diff options
author | Edward Hill <ecgh@chromium.org> | 2018-11-27 15:50:24 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-12-03 12:43:30 -0800 |
commit | 20499e311a9873071014b05817dacc289990ff28 (patch) | |
tree | 68c7bf881127b982fc05be62812224e482e197ea | |
parent | 9fbddbcad087ba62f1c325af66995211fa0c611f (diff) | |
download | chrome-ec-20499e311a9873071014b05817dacc289990ff28.tar.gz |
chgstv2: Fix battery_near_full() with full battery
Use charge_get_percent() instead of curr.batt.state_of_charge in
battery_near_full() to ensure battery_near_full() will always
return 1 when the battery is full and not accepting current
(is_full == 1).
BUG=b:119886140
BRANCH=grunt
TEST=Delan shows "full" LED when battery FULL bit set
Change-Id: Ib8f0f1f19b105cee979a365db61113ea276feebf
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1352068
Tested-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/charge_state_v2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index bdba1218bf..45f8ece5b5 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -2062,7 +2062,7 @@ int charge_prevent_power_on(int power_button_pressed) static int battery_near_full(void) { - if (curr.batt.state_of_charge < BATTERY_LEVEL_NEAR_FULL) + if (charge_get_percent() < BATTERY_LEVEL_NEAR_FULL) return 0; #ifdef CONFIG_EC_EC_COMM_BATTERY_MASTER |