summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin Lu <Devin.Lu@quantatw.com>2021-12-03 13:45:54 +0800
committerCommit Bot <commit-bot@chromium.org>2021-12-07 01:36:39 +0000
commita105f637e3593615fe2dfa35275d9caa911aed26 (patch)
treeb8fcfbffbfd3abd45b078d1b15e2749ef7a52d2e
parentd904e03a2ccce4a8121b2aece083bb723423fcfc (diff)
downloadchrome-ec-a105f637e3593615fe2dfa35275d9caa911aed26.tar.gz
redrix: Update charging LEDs behavior
This patch updates the LEDs behavior. Change as below: 1. battery error: Original - Blinking white quickly. (0.5 sec ON, 0.5 sec OFF) New - Blinking amber quickly. (0.5 sec ON, 0.5 sec OFF) 2. battery low: Original - Blinking white slowly on right side led. (1 sec ON, 1 sec OFF) New - Blinking amber slowly on both side leds. (1 sec ON, 1 sec OFF) BUG=b:208912133 BRANCH=none TEST=Verify LEDs worked indeed. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I2ce233d57eb168b47d8dbcb724890e6e5f196f77 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3314261 Commit-Queue: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
-rw-r--r--board/redrix/led.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/board/redrix/led.c b/board/redrix/led.c
index c794bc8b5f..ca98daaf63 100644
--- a/board/redrix/led.c
+++ b/board/redrix/led.c
@@ -174,17 +174,23 @@ static void led_set_battery(void)
if (charge_get_percent() < 10)
led_set_color_battery(RIGHT_PORT,
(battery_ticks % LED_TICKS_PER_CYCLE
- < LED_ON_TICKS) ? LED_WHITE : LED_OFF);
+ < LED_ON_TICKS) ? LED_AMBER : LED_OFF);
else
led_set_color_battery(RIGHT_PORT, LED_OFF);
}
- if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED))
- led_set_color_battery(LEFT_PORT, LED_OFF);
+ if (led_auto_control_is_enabled(EC_LED_ID_LEFT_LED)) {
+ if (charge_get_percent() < 10)
+ led_set_color_battery(LEFT_PORT,
+ (battery_ticks % LED_TICKS_PER_CYCLE
+ < LED_ON_TICKS) ? LED_AMBER : LED_OFF);
+ else
+ led_set_color_battery(LEFT_PORT, LED_OFF);
+ }
break;
case PWR_STATE_ERROR:
set_active_port_color((battery_ticks & 0x1) ?
- LED_WHITE : LED_OFF);
+ LED_AMBER : LED_OFF);
break;
case PWR_STATE_CHARGE_NEAR_FULL:
set_active_port_color(LED_WHITE);