summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/nocturne/board.h3
-rw-r--r--board/nocturne/led.c13
2 files changed, 11 insertions, 5 deletions
diff --git a/board/nocturne/board.h b/board/nocturne/board.h
index c94ca190b2..0852b4fbb1 100644
--- a/board/nocturne/board.h
+++ b/board/nocturne/board.h
@@ -78,7 +78,10 @@
/* LEDs */
#define CONFIG_LED_COMMON
+#define CONFIG_LED_PWM_ACTIVE_CHARGE_PORT_ONLY
#define CONFIG_LED_PWM_COUNT 2
+#undef CONFIG_LED_PWM_NEAR_FULL_COLOR
+#define CONFIG_LED_PWM_NEAR_FULL_COLOR EC_LED_COLOR_WHITE
/* MKBP */
#define CONFIG_MKBP_EVENT
diff --git a/board/nocturne/led.c b/board/nocturne/led.c
index 68b19f0bbe..993e0c4c1a 100644
--- a/board/nocturne/led.c
+++ b/board/nocturne/led.c
@@ -17,14 +17,13 @@ const enum ec_led_id supported_led_ids[] = {
};
const int supported_led_ids_count = ARRAY_SIZE(supported_led_ids);
-/* We may not be using the blue channel long term. */
struct pwm_led led_color_map[EC_LED_COLOR_COUNT] = {
/* Red, Green, Blue */
[EC_LED_COLOR_RED] = { 1, 0, 0 },
[EC_LED_COLOR_GREEN] = { 0, 1, 0 },
- [EC_LED_COLOR_BLUE] = { 0, 0, 0 },
+ [EC_LED_COLOR_BLUE] = { 0, 0, 1 },
[EC_LED_COLOR_YELLOW] = { 1, 1, 0 },
- [EC_LED_COLOR_WHITE] = { 0, 0, 0 },
+ [EC_LED_COLOR_WHITE] = { 9, 15, 15 },
[EC_LED_COLOR_AMBER] = { 15, 1, 0 },
};
@@ -49,8 +48,8 @@ void led_get_brightness_range(enum ec_led_id led_id, uint8_t *brightness_range)
brightness_range[EC_LED_COLOR_GREEN] = 100;
brightness_range[EC_LED_COLOR_YELLOW] = 100;
brightness_range[EC_LED_COLOR_AMBER] = 100;
- brightness_range[EC_LED_COLOR_BLUE] = 0;
- brightness_range[EC_LED_COLOR_WHITE] = 0;
+ brightness_range[EC_LED_COLOR_BLUE] = 100;
+ brightness_range[EC_LED_COLOR_WHITE] = 100;
}
int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
@@ -73,6 +72,10 @@ int led_set_brightness(enum ec_led_id led_id, const uint8_t *brightness)
set_pwm_led_color(pwm_id, EC_LED_COLOR_YELLOW);
else if (brightness[EC_LED_COLOR_AMBER])
set_pwm_led_color(pwm_id, EC_LED_COLOR_AMBER);
+ else if (brightness[EC_LED_COLOR_BLUE])
+ set_pwm_led_color(pwm_id, EC_LED_COLOR_BLUE);
+ else if (brightness[EC_LED_COLOR_WHITE])
+ set_pwm_led_color(pwm_id, EC_LED_COLOR_WHITE);
else
/* Otherwise, the "color" is "off". */
set_pwm_led_color(pwm_id, -1);