Waddledee: Add more LED colors
Add more colors for the RGB LED to produce.
BRANCH=None
TEST=with ledtest command enabled, set LED to each new color to confirm
it looks like the named color
@@ -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);
