From 7ba6456c0b2e041bb9f97dbed265c5b8b4b12192 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 31 Dec 2019 08:33:49 -0800 Subject: Use White channel on RGBW LEDs (#7678) * Use White channel on RGBW LEDs Co-authored-by: kwerdenker * Manually apply white channel to array * Move where convert_rgb_to_rgbw is called * Fix type for rgbw led struct * Add changes to Ergodox EZ can revert if deemed necessary * Revert "Add changes to Ergodox EZ" This reverts commit aa44db198d40d758ca10470eb94615513592d1dd. * Revert "Fix type for rgbw led struct" This reverts commit c5c744cba040201cc0d124400773cf13f8a2cf22. * Revert "Move where convert_rgb_to_rgbw is called" This reverts commit cd7f17caf6dd30731c54b3be54490fe4519444f9. * Revert changes and fix up functions * Enable white channel for Ergodox EZ as well * Only run conversion of rgblight is enabled Co-authored-by: kwerdenker --- quantum/rgblight.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'quantum/rgblight.c') diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 7949bb688e..141dc2e7bc 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -611,6 +611,7 @@ void rgblight_set(void) { # endif } } + # ifdef RGBLIGHT_LED_MAP LED_TYPE led0[RGBLED_NUM]; for (uint8_t i = 0; i < RGBLED_NUM; i++) { @@ -620,7 +621,13 @@ void rgblight_set(void) { # else start_led = led + clipping_start_pos; # endif - ws2812_setleds(start_led, num_leds); + +#ifdef RGBW + for (uint8_t i = 0; i < num_leds; i++) { + convert_rgb_to_rgbw(&start_led[i]); + } +#endif + ws2812_setleds(start_led, num_leds); } #endif -- cgit v1.2.3