Move where convert_rgb_to_rgbw is called

This commit is contained in:
Drashna Jael're 2019-12-25 14:55:45 -08:00
parent 578bf44204
commit cd7f17caf6
No known key found for this signature in database
GPG Key ID: DBA1FD3A860D1B11

View File

@ -601,8 +601,8 @@ void rgblight_set(void) {
LED_TYPE *start_led;
uint16_t num_leds = clipping_num_leds;
if (!rgblight_config.enable) {
for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) {
for (uint8_t i = effect_start_pos; i < effect_end_pos; i++) {
if (!rgblight_config.enable) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
@ -610,10 +610,13 @@ void rgblight_set(void) {
led[i].w = 0;
# endif
}
# ifdef RGBW
else {
convert_rgb_to_rgbw(led[i]);
}
#endif
}
# ifdef RGBLIGHT_LED_MAP
LED_TYPE led0[RGBLED_NUM];
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
@ -623,13 +626,7 @@ void rgblight_set(void) {
# else
start_led = led + clipping_start_pos;
# endif
#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);
ws2812_setleds(start_led, num_leds);
}
#endif