diff options
author | Diana Z <dzigterman@chromium.org> | 2020-04-07 15:14:07 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-09 00:18:42 +0000 |
commit | 4d39614441258dc5788c2a55000abe56ac43d3fe (patch) | |
tree | 76ec8582cce5e761b0b0d4e92d7cd82e8ce724e5 /board | |
parent | 752edaacb1867a74e548308217f843ea7a2962eb (diff) | |
download | chrome-ec-4d39614441258dc5788c2a55000abe56ac43d3fe.tar.gz |
Waddledee: Add more LED colors
Add more colors for the RGB LED to produce.
BUG=None
BRANCH=None
TEST=with ledtest command enabled, set LED to each new color to confirm
it looks like the named color
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iab86e7236796c52948f7e055c69b29b72473d7cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2142560
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/waddledee/led.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/board/waddledee/led.c b/board/waddledee/led.c index f8c34eb078..b19e594fbd 100644 --- a/board/waddledee/led.c +++ b/board/waddledee/led.c @@ -24,9 +24,9 @@ struct pwm_led led_color_map[EC_LED_COLOR_COUNT] = { [EC_LED_COLOR_RED] = { 100, 0, 0 }, [EC_LED_COLOR_GREEN] = { 0, 100, 0 }, [EC_LED_COLOR_BLUE] = { 0, 0, 100 }, - [EC_LED_COLOR_YELLOW] = { 0, 0, 0 }, - [EC_LED_COLOR_WHITE] = { 0, 0, 0 }, - [EC_LED_COLOR_AMBER] = { 0, 0, 0 }, + [EC_LED_COLOR_YELLOW] = { 50, 50, 0 }, + [EC_LED_COLOR_WHITE] = { 50, 50, 50 }, + [EC_LED_COLOR_AMBER] = { 70, 30, 0 }, }; /* One logical LED with red, green, and blue channels. */ @@ -47,6 +47,9 @@ void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range) brightness_range[EC_LED_COLOR_RED] = 100; brightness_range[EC_LED_COLOR_GREEN] = 100; brightness_range[EC_LED_COLOR_BLUE] = 100; + brightness_range[EC_LED_COLOR_YELLOW] = 100; + brightness_range[EC_LED_COLOR_WHITE] = 100; + brightness_range[EC_LED_COLOR_AMBER] = 100; } int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) @@ -65,6 +68,12 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness) set_pwm_led_color(pwm_id, EC_LED_COLOR_GREEN); else if (brightness[EC_LED_COLOR_BLUE]) set_pwm_led_color(pwm_id, EC_LED_COLOR_BLUE); + else if (brightness[EC_LED_COLOR_YELLOW]) + set_pwm_led_color(pwm_id, EC_LED_COLOR_YELLOW); + else if (brightness[EC_LED_COLOR_WHITE]) + set_pwm_led_color(pwm_id, EC_LED_COLOR_WHITE); + else if (brightness[EC_LED_COLOR_AMBER]) + set_pwm_led_color(pwm_id, EC_LED_COLOR_AMBER); else /* Otherwise, the "color" is "off". */ set_pwm_led_color(pwm_id, -1); |