From 660e372620d96d3ddceb8414f9239d77a4bafc4b Mon Sep 17 00:00:00 2001 From: Kai Ryu Date: Thu, 23 Apr 2015 19:46:29 +0900 Subject: [PATCH] Support separated LED of switches for Staryu --- keyboard/staryu/backlight.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/keyboard/staryu/backlight.c b/keyboard/staryu/backlight.c index 11c55d63..62c1c648 100644 --- a/keyboard/staryu/backlight.c +++ b/keyboard/staryu/backlight.c @@ -131,12 +131,12 @@ void action_keyevent(keyevent_t event) if (backlight_config.enable) { if (backlight_config.level == 7) { if (event.pressed) { - softpwm_led_decrease_all(32); + softpwm_led_decrease(event.key.col, 32); } } if (backlight_config.level == 8) { if (event.pressed) { - softpwm_led_increase_all(32); + softpwm_led_increase(event.key.col, 32); } } } @@ -145,7 +145,11 @@ void action_keyevent(keyevent_t event) #ifdef CUSTOM_LED_ENABLE void fading_led_custom(uint8_t *value) { - rgb_set_brightness(*value); + uint8_t max = 0; + for (uint8_t i = 0; i < LED_COUNT; i++) { + if (value[i] > max) max = value[i]; + } + rgb_set_brightness(max); } void breathing_led_custom(uint8_t *value)