diff options
author | nickchen <nickchen@ami.corp-partner.google.com> | 2018-07-27 11:31:25 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-31 07:15:45 -0700 |
commit | b4ba711ebaf7663b6ca7ddd33e942d6a7b6f52f7 (patch) | |
tree | bd0d43866f0c55f81c87f57d384489e477c94813 /baseboard | |
parent | fc2281cc2d3dce0476505f56e76a24059d74009f (diff) | |
download | chrome-ec-b4ba711ebaf7663b6ca7ddd33e942d6a7b6f52f7.tar.gz |
phaser: Fix ectool led on/off/auto controls
Phaser systems include power and battery LED and they were not being
covered for ectool led commands. This CL adds the support for POWER_LED
and BATTERT_LED, so that ectool led can control both power button led
and battery led. In addition, fix "ectool led power auto" can adjust
power led status immediately.
BUG=b:80501031, b:110086152
BRANCH=none
TEST=Verified all leds color and behavior can work as expected.
ectool led battery red|amber|green|off|auto
ectool led power white|off|auto
make buildall pass.
Change-Id: I68b31114e89786f82b5c0fa6bf437c041f5a4fd0
Signed-off-by: nickchen <nickchen@ami.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/1152343
Commit-Ready: Nick Chen <nickchen@ami.corp-partner.google.com>
Tested-by: Nick Chen <nickchen@ami.corp-partner.google.com>
Tested-by: Chao Ding <chao.ding@bitland.corp-partner.google.com>
Reviewed-by: Chao Ding <chao.ding@bitland.corp-partner.google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/octopus/led_states.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/baseboard/octopus/led_states.c b/baseboard/octopus/led_states.c index 43bad48b6e..e5bd5adaa0 100644 --- a/baseboard/octopus/led_states.c +++ b/baseboard/octopus/led_states.c @@ -72,16 +72,11 @@ static void led_update_battery(void) int phase; enum led_states desired_state = led_get_state(); - if (desired_state == led_state && period == LED_INDEFINITE) - /* - * No change needed if we're on the same state and - * it's configured to be solid - */ - return; - /* - * If we're in a new valid state, update our ticks and period info. - * If our new state isn't defined, continue using the previous one + * We always need to check the current state since the value could + * have been manually overwritten. If we're in a new valid state, + * update our ticks and period info. If our new state isn't defined, + * continue using the previous one. */ if (desired_state != led_state && desired_state < LED_NUM_STATES) { /* State is changing */ |