summaryrefslogtreecommitdiff
path: root/common/led_pwm.c
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-09-23 17:13:21 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-13 03:32:56 -0800
commit9b0e034c637008be16dcef6d7826dc2d56216945 (patch)
treec6ce0c04c9c860b957fc1d9a40a1d808d90b7726 /common/led_pwm.c
parentea653811fbf78f46df24a6761538a674b281a8fc (diff)
downloadchrome-ec-9b0e034c637008be16dcef6d7826dc2d56216945.tar.gz
led_pwm: Fix pulsing bug after init.
When the LED code starts determining what pattern to display, the charge state machine returns an error briefly at init. (The error is that the battery present status is unknown). Once it determines the battery is present, it no longer returns an error, but the LED code doesn't cancel the pulsing pattern. This commit simply fixes that bug. BUG=None BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne; hibernate; wake via power button, verify that the LEDs do not pulse red continuously. Change-Id: Ibe225ba4c136b8758948bd72d9ba688cff15d9e9 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/1239548 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> (cherry picked from commit a7a9223c640cfbd86fb0cac4d60d5ee9a233cc8c) Reviewed-on: https://chromium-review.googlesource.com/1332809 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/led_pwm.c')
-rw-r--r--common/led_pwm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/led_pwm.c b/common/led_pwm.c
index 879b9f7bfc..b9d13a3d6c 100644
--- a/common/led_pwm.c
+++ b/common/led_pwm.c
@@ -160,6 +160,14 @@ static int show_charge_state(void)
pulse_leds(CONFIG_LED_PWM_CHARGE_ERROR_COLOR, 1, 2);
} else {
/* Discharging or not charging. */
+#ifdef CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY
+ /*
+ * If we only show the active charge port, the only reason we
+ * would pulse the LEDs is if we had an error. If it no longer
+ * exists, stop pulsing the LEDs.
+ */
+ led_is_pulsing = 0;
+#endif /* CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY */
return 0;
}
return 1;