summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaveh Jalali <caveh@chromium.org>2019-04-16 20:05:31 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-04-18 04:46:54 +0000
commit2cf498c23ca0bc788518635d8ea565f94ce2979b (patch)
tree510e57d65656bc5b04bafb00f5e0522d6a97feb9
parentd24a051318f521a5a1c4b09e2a0dbf24f42d1439 (diff)
downloadchrome-ec-2cf498c23ca0bc788518635d8ea565f94ce2979b.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/c/chromiumos/platform/ec/+/1570612 Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com>
-rw-r--r--common/led_pwm.c3
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) ||