diff options
author | Caveh Jalali <caveh@chromium.org> | 2019-04-16 20:05:31 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-18 19:52:00 -0700 |
commit | 521db7dfbff864bf4fd2442a6129872b6b4ea873 (patch) | |
tree | 0c7460cfb6219d1d3987c5308aafcd62a48b6add /common | |
parent | d584b1b4e05251774f61b77acf88deac2448af54 (diff) | |
download | chrome-ec-521db7dfbff864bf4fd2442a6129872b6b4ea873.tar.gz |
led_pwm: use NEAR_FULL_COLOR when discharging-on-ac
when CONFIG_PWR_STATE_DISCHARGE_FULL is enabled for a board, the
charge state machine can enter a special PWR_STATE_DISCHARGE_FULL
state used to indicate that we're on AC but powering the system from
the battery. the system will hover in-and-out of this state over time
while on AC. this should generally be transparent to the user, so we
should indicate it using the LEDs the same way we indicate
PWR_STATE_CHARGE_NEAR_FULL.
BUG=b:128709632
BRANCH=none
TEST=verified LED stays white on atlas while battery is draining on
AC. LED goes out when charger is removed
Change-Id: I3af6783bcdbe399a444099fcee8ebab07451ff2c
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1570613
Commit-Ready: Caveh Jalali <caveh@google.com>
Tested-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/led_pwm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/led_pwm.c b/common/led_pwm.c index 87ec59a127..d167a5bd6f 100644 --- a/common/led_pwm.c +++ b/common/led_pwm.c @@ -151,7 +151,8 @@ static int show_charge_state(void) if (chg_st == PWR_STATE_CHARGE) { led_is_pulsing = 0; set_led_color(CONFIG_LED_PWM_CHARGE_COLOR); - } else if (chg_st == PWR_STATE_CHARGE_NEAR_FULL) { + } else if (chg_st == PWR_STATE_CHARGE_NEAR_FULL || + chg_st == PWR_STATE_DISCHARGE_FULL) { led_is_pulsing = 0; set_led_color(CONFIG_LED_PWM_NEAR_FULL_COLOR); } else if ((battery_is_present() != BP_YES) || |