summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2013-02-06 10:47:11 +0800
committerChromeBot <chrome-bot@google.com>2013-02-05 23:20:17 -0800
commite9c3b705d5efd8e691e6ddbd198b543a11db7997 (patch)
tree9382120a4723cc7c6b8ba7fe158fdcd35ad14d64
parente955c627920edc591b2473470fa5de06c3f62e31 (diff)
downloadchrome-ec-e9c3b705d5efd8e691e6ddbd198b543a11db7997.tar.gz
spring: Tweak battery LED policy
When battery is nearly full, we sometimes see: - Battery asks for no current, but slowly discharge (5-7 mA) - Battery asks for current, but not charging. For these cases, we consider the battery full and show green LED. BUG=chrome-os-partner:17561 TEST=Manual BRANCH=none Change-Id: I2808d4c1a89d37000244fb308197cdef473ec5be Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42688 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/board.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/board/spring/board.c b/board/spring/board.c
index 3b26ab4cf9..2867128050 100644
--- a/board/spring/board.c
+++ b/board/spring/board.c
@@ -301,6 +301,7 @@ int board_get_ac(void)
int board_battery_led(enum charging_state state)
{
int current;
+ int desired_current;
uint32_t color = LED_COLOR_RED;
/*
@@ -316,12 +317,13 @@ int board_battery_led(enum charging_state state)
color = LED_COLOR_YELLOW;
break;
case ST_CHARGING:
- if (battery_desired_current(&current)) {
+ if (battery_current(&current) ||
+ battery_desired_current(&desired_current)) {
/* Cannot talk to the battery. Set LED to red. */
color = LED_COLOR_RED;
break;
}
- if (current)
+ if (current && desired_current)
color = LED_COLOR_YELLOW;
else
color = LED_COLOR_GREEN;