From 311812b5697000e68cfe50181997a7d78382c991 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Thu, 25 Jul 2013 22:23:57 -0700 Subject: spring: Show yellow LED for battery not fully charged in idle state Even if the charge state machine is in idle mode, we should still show yellow LED if the battery is not fully charged. This prevents the case where the LED is green when the battery just comes back from cut-off mode. BUG=None TEST=Cut off the battery. Plug in the charger and doesn't see green LED. BRANCH=Spring Change-Id: I079bcc19fcfff98a498cd9e3d2f99f0566b15fe4 Original-Change-Id: I14e6b3d32e04992bd8291da4b8b95e8e23a3acf0 Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/63459 Reviewed-by: Vincent Palatin Reviewed-on: https://gerrit.chromium.org/gerrit/64274 --- common/led_lp5562.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/led_lp5562.c b/common/led_lp5562.c index bf0c86321b..a35332be9b 100644 --- a/common/led_lp5562.c +++ b/common/led_lp5562.c @@ -150,14 +150,12 @@ static void battery_led_update(void) * set color here. */ switch (charge_get_state()) { - case ST_IDLE: - state = LED_STATE_SOLID_GREEN; - break; case ST_IDLE0: case ST_BAD_COND: case ST_PRE_CHARGING: state = LED_STATE_SOLID_YELLOW; break; + case ST_IDLE: case ST_DISCHARGING: case ST_CHARGING: if (battery_state_of_charge(&state_of_charge)) { -- cgit v1.2.1