diff options
author | Duncan Laurie <dlaurie@google.com> | 2017-02-06 16:27:47 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-07 20:14:30 -0800 |
commit | 9aadad932f465bc0e23041d15afdacc6b6782061 (patch) | |
tree | 687fe5742ad60eb4a34d625b5e7cbadec8bc39ee /board/eve/led.c | |
parent | 358bc0a7fde4ab84bec1e7e04030124780987173 (diff) | |
download | chrome-ec-9aadad932f465bc0e23041d15afdacc6b6782061.tar.gz |
eve: LED changes
- Use amber for charge when in suspend/off states and leave red
to indicate something is wrong.
- Blink non-charging LED in S0ix/S3 states.
BUG=chrome-os-partner:60797
BRANCH=none
TEST=verify led operation in s3/s5 while charging
Change-Id: I16660942bf93f7cf6c951c19548c1c6838aabb72
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/438707
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/eve/led.c')
-rw-r--r-- | board/eve/led.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/board/eve/led.c b/board/eve/led.c index cf696c4a3c..763a0766f9 100644 --- a/board/eve/led.c +++ b/board/eve/led.c @@ -136,14 +136,21 @@ static void eve_led_set_power_battery(void) /* Suspend or Standby state */ if (chipset_in_state(CHIPSET_STATE_SUSPEND) || chipset_in_state(CHIPSET_STATE_STANDBY)) { - if (chg_state == PWR_STATE_DISCHARGE) { + enum led_side blinkside = LED_BOTH; + + if (chg_state == PWR_STATE_CHARGE) { + set_color(LED_AMBER, side); + blinkside = !side; + } + if (chg_state == PWR_STATE_DISCHARGE || + chg_state == PWR_STATE_CHARGE) { /* - * If in S3/S0iX and not charging or in some error - * state, then flash both LEDs white. + * If in S3/S0iX and not in some error + * state, then flash non-charging LEDs white. */ set_color(((power_ticks++ % LED_TOTAL_TICKS) < LED_ON_TICKS) ? - LED_WHITE : LED_OFF, LED_BOTH); + LED_WHITE : LED_OFF, blinkside); return; } } @@ -155,7 +162,7 @@ static void eve_led_set_power_battery(void) break; case PWR_STATE_CHARGE: set_color(LED_OFF, LED_BOTH); - set_color(LED_RED, side); + set_color(LED_AMBER, side); break; case PWR_STATE_ERROR: set_color(((power_ticks++ % LED_TOTAL_TICKS) |