diff options
Diffstat (limited to 'quantum')
23 files changed, 79 insertions, 61 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5ca9b87a6..8c16c7790 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
@@ -162,28 +162,11 @@ void rgb_matrix_update_pwm_buffers(void) { | |||
162 | } | 162 | } |
163 | 163 | ||
164 | void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { | 164 | void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { |
165 | #ifdef RGB_MATRIX_EXTRA_TOG | ||
166 | const bool is_key = g_rgb_leds[index].matrix_co.raw != 0xff; | ||
167 | if ( | ||
168 | (rgb_matrix_config.enable == RGB_ZONE_KEYS && !is_key) || | ||
169 | (rgb_matrix_config.enable == RGB_ZONE_UNDER && is_key) | ||
170 | ) { | ||
171 | rgb_matrix_driver.set_color(index, 0, 0, 0); | ||
172 | return; | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | rgb_matrix_driver.set_color(index, red, green, blue); | 165 | rgb_matrix_driver.set_color(index, red, green, blue); |
177 | } | 166 | } |
178 | 167 | ||
179 | void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { | 168 | void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { |
180 | #ifdef RGB_MATRIX_EXTRA_TOG | ||
181 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | ||
182 | rgb_matrix_set_color(i, red, green, blue); | ||
183 | } | ||
184 | #else | ||
185 | rgb_matrix_driver.set_color_all(red, green, blue); | 169 | rgb_matrix_driver.set_color_all(red, green, blue); |
186 | #endif | ||
187 | } | 170 | } |
188 | 171 | ||
189 | bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { | 172 | bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { |
@@ -262,7 +245,7 @@ static bool rgb_matrix_none(effect_params_t* params) { | |||
262 | 245 | ||
263 | static uint8_t rgb_last_enable = UINT8_MAX; | 246 | static uint8_t rgb_last_enable = UINT8_MAX; |
264 | static uint8_t rgb_last_effect = UINT8_MAX; | 247 | static uint8_t rgb_last_effect = UINT8_MAX; |
265 | static effect_params_t rgb_effect_params = { 0, 0 }; | 248 | static effect_params_t rgb_effect_params = { 0, 0xFF }; |
266 | static rgb_task_states rgb_task_state = SYNCING; | 249 | static rgb_task_states rgb_task_state = SYNCING; |
267 | 250 | ||
268 | static void rgb_task_timers(void) { | 251 | static void rgb_task_timers(void) { |
@@ -575,29 +558,31 @@ void rgb_matrix_set_suspend_state(bool state) { | |||
575 | } | 558 | } |
576 | 559 | ||
577 | void rgb_matrix_toggle(void) { | 560 | void rgb_matrix_toggle(void) { |
578 | rgb_matrix_config.enable++; | 561 | rgb_matrix_config.enable ^= 1; |
579 | if (!rgb_matrix_config.enable) { | 562 | rgb_task_state = STARTING; |
580 | rgb_task_state = STARTING; | ||
581 | } | ||
582 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); | 563 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); |
583 | } | 564 | } |
584 | 565 | ||
585 | void rgb_matrix_enable(void) { | 566 | void rgb_matrix_enable(void) { |
586 | rgb_matrix_config.enable = 1; | 567 | rgb_matrix_enable_noeeprom(); |
587 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); | 568 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); |
588 | } | 569 | } |
589 | 570 | ||
590 | void rgb_matrix_enable_noeeprom(void) { | 571 | void rgb_matrix_enable_noeeprom(void) { |
591 | rgb_matrix_config.enable = 1; | 572 | if (!rgb_matrix_config.enable) |
573 | rgb_task_state = STARTING; | ||
574 | rgb_matrix_config.enable = 1; | ||
592 | } | 575 | } |
593 | 576 | ||
594 | void rgb_matrix_disable(void) { | 577 | void rgb_matrix_disable(void) { |
595 | rgb_matrix_config.enable = 0; | 578 | rgb_matrix_disable_noeeprom(); |
596 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); | 579 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw); |
597 | } | 580 | } |
598 | 581 | ||
599 | void rgb_matrix_disable_noeeprom(void) { | 582 | void rgb_matrix_disable_noeeprom(void) { |
600 | rgb_matrix_config.enable = 0; | 583 | if (rgb_matrix_config.enable) |
584 | rgb_task_state = STARTING; | ||
585 | rgb_matrix_config.enable = 0; | ||
601 | } | 586 | } |
602 | 587 | ||
603 | void rgb_matrix_step(void) { | 588 | void rgb_matrix_step(void) { |
@@ -658,6 +643,14 @@ void rgb_matrix_decrease_speed(void) { | |||
658 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this | 643 | eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this |
659 | } | 644 | } |
660 | 645 | ||
646 | led_flags_t rgb_matrix_get_flags(void) { | ||
647 | return rgb_effect_params.flags; | ||
648 | } | ||
649 | |||
650 | void rgb_matrix_set_flags(led_flags_t flags) { | ||
651 | rgb_effect_params.flags = flags; | ||
652 | } | ||
653 | |||
661 | void rgb_matrix_mode(uint8_t mode) { | 654 | void rgb_matrix_mode(uint8_t mode) { |
662 | rgb_matrix_config.mode = mode; | 655 | rgb_matrix_config.mode = mode; |
663 | rgb_task_state = STARTING; | 656 | rgb_task_state = STARTING; |
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 775cbeac0..33665ffff 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
@@ -54,7 +54,9 @@ | |||
54 | uint8_t max = DRIVER_LED_TOTAL; | 54 | uint8_t max = DRIVER_LED_TOTAL; |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 57 | #define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue |
58 | |||
59 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | ||
58 | 60 | ||
59 | typedef struct | 61 | typedef struct |
60 | { | 62 | { |
@@ -209,6 +211,8 @@ void rgb_matrix_increase_val(void); | |||
209 | void rgb_matrix_decrease_val(void); | 211 | void rgb_matrix_decrease_val(void); |
210 | void rgb_matrix_increase_speed(void); | 212 | void rgb_matrix_increase_speed(void); |
211 | void rgb_matrix_decrease_speed(void); | 213 | void rgb_matrix_decrease_speed(void); |
214 | led_flags_t rgb_matrix_get_flags(void); | ||
215 | void rgb_matrix_set_flags(led_flags_t flags); | ||
212 | void rgb_matrix_mode(uint8_t mode); | 216 | void rgb_matrix_mode(uint8_t mode); |
213 | void rgb_matrix_mode_noeeprom(uint8_t mode); | 217 | void rgb_matrix_mode_noeeprom(uint8_t mode); |
214 | uint8_t rgb_matrix_get_mode(void); | 218 | uint8_t rgb_matrix_get_mode(void); |
diff --git a/quantum/rgb_matrix_animations/alpha_mods_anim.h b/quantum/rgb_matrix_animations/alpha_mods_anim.h index cc1914d7f..4bd01c4fc 100644 --- a/quantum/rgb_matrix_animations/alpha_mods_anim.h +++ b/quantum/rgb_matrix_animations/alpha_mods_anim.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS | 2 | #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS |
3 | 3 | ||
4 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 4 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
5 | extern rgb_config_t rgb_matrix_config; | 5 | extern rgb_config_t rgb_matrix_config; |
6 | 6 | ||
7 | // alphas = color1, mods = color2 | 7 | // alphas = color1, mods = color2 |
@@ -14,7 +14,8 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) { | |||
14 | RGB rgb2 = hsv_to_rgb(hsv); | 14 | RGB rgb2 = hsv_to_rgb(hsv); |
15 | 15 | ||
16 | for (uint8_t i = led_min; i < led_max; i++) { | 16 | for (uint8_t i = led_min; i < led_max; i++) { |
17 | if (g_rgb_leds[i].modifier) { | 17 | RGB_MATRIX_TEST_LED_FLAGS(); |
18 | if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) { | ||
18 | rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); | 19 | rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b); |
19 | } else { | 20 | } else { |
20 | rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); | 21 | rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b); |
diff --git a/quantum/rgb_matrix_animations/breathing_anim.h b/quantum/rgb_matrix_animations/breathing_anim.h index 4a9a1dcdb..54d60f927 100644 --- a/quantum/rgb_matrix_animations/breathing_anim.h +++ b/quantum/rgb_matrix_animations/breathing_anim.h | |||
@@ -12,6 +12,7 @@ bool rgb_matrix_breathing(effect_params_t* params) { | |||
12 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, val }; | 12 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, val }; |
13 | RGB rgb = hsv_to_rgb(hsv); | 13 | RGB rgb = hsv_to_rgb(hsv); |
14 | for (uint8_t i = led_min; i < led_max; i++) { | 14 | for (uint8_t i = led_min; i < led_max; i++) { |
15 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
15 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
16 | } | 17 | } |
17 | return led_max < DRIVER_LED_TOTAL; | 18 | return led_max < DRIVER_LED_TOTAL; |
diff --git a/quantum/rgb_matrix_animations/cycle_all_anim.h b/quantum/rgb_matrix_animations/cycle_all_anim.h index 5c18cfa0c..513dff128 100644 --- a/quantum/rgb_matrix_animations/cycle_all_anim.h +++ b/quantum/rgb_matrix_animations/cycle_all_anim.h | |||
@@ -2,16 +2,16 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL | 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_cycle_all(effect_params_t* params) { | 8 | bool rgb_matrix_cycle_all(effect_params_t* params) { |
9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 9 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
10 | 10 | ||
11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); | 12 | hsv.h = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); |
13 | for (uint8_t i = led_min; i < led_max; i++) { | 13 | for (uint8_t i = led_min; i < led_max; i++) { |
14 | hsv.h = time; | 14 | RGB_MATRIX_TEST_LED_FLAGS(); |
15 | RGB rgb = hsv_to_rgb(hsv); | 15 | RGB rgb = hsv_to_rgb(hsv); |
16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 16 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
17 | } | 17 | } |
diff --git a/quantum/rgb_matrix_animations/cycle_left_right_anim.h b/quantum/rgb_matrix_animations/cycle_left_right_anim.h index f519aeb47..428adea22 100644 --- a/quantum/rgb_matrix_animations/cycle_left_right_anim.h +++ b/quantum/rgb_matrix_animations/cycle_left_right_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT | 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_cycle_left_right(effect_params_t* params) { | 8 | bool rgb_matrix_cycle_left_right(effect_params_t* params) { |
@@ -11,6 +11,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) { | |||
11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); | 12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); |
13 | for (uint8_t i = led_min; i < led_max; i++) { | 13 | for (uint8_t i = led_min; i < led_max; i++) { |
14 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
14 | point_t point = g_rgb_leds[i].point; | 15 | point_t point = g_rgb_leds[i].point; |
15 | hsv.h = point.x - time; | 16 | hsv.h = point.x - time; |
16 | RGB rgb = hsv_to_rgb(hsv); | 17 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/cycle_up_down_anim.h b/quantum/rgb_matrix_animations/cycle_up_down_anim.h index 8b91d890d..ea63095d2 100644 --- a/quantum/rgb_matrix_animations/cycle_up_down_anim.h +++ b/quantum/rgb_matrix_animations/cycle_up_down_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN | 2 | #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_cycle_up_down(effect_params_t* params) { | 8 | bool rgb_matrix_cycle_up_down(effect_params_t* params) { |
@@ -11,6 +11,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) { | |||
11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); | 12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); |
13 | for (uint8_t i = led_min; i < led_max; i++) { | 13 | for (uint8_t i = led_min; i < led_max; i++) { |
14 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
14 | point_t point = g_rgb_leds[i].point; | 15 | point_t point = g_rgb_leds[i].point; |
15 | hsv.h = point.y - time; | 16 | hsv.h = point.y - time; |
16 | RGB rgb = hsv_to_rgb(hsv); | 17 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/dual_beacon_anim.h b/quantum/rgb_matrix_animations/dual_beacon_anim.h index dda315780..00f6e5088 100644 --- a/quantum/rgb_matrix_animations/dual_beacon_anim.h +++ b/quantum/rgb_matrix_animations/dual_beacon_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON | 2 | #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_dual_beacon(effect_params_t* params) { | 8 | bool rgb_matrix_dual_beacon(effect_params_t* params) { |
@@ -13,6 +13,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) { | |||
13 | int8_t cos_value = cos8(time) - 128; | 13 | int8_t cos_value = cos8(time) - 128; |
14 | int8_t sin_value = sin8(time) - 128; | 14 | int8_t sin_value = sin8(time) - 128; |
15 | for (uint8_t i = led_min; i < led_max; i++) { | 15 | for (uint8_t i = led_min; i < led_max; i++) { |
16 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
16 | point_t point = g_rgb_leds[i].point; | 17 | point_t point = g_rgb_leds[i].point; |
17 | hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; | 18 | hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; |
18 | RGB rgb = hsv_to_rgb(hsv); | 19 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/gradient_up_down_anim.h b/quantum/rgb_matrix_animations/gradient_up_down_anim.h index 11498e22f..05117540a 100644 --- a/quantum/rgb_matrix_animations/gradient_up_down_anim.h +++ b/quantum/rgb_matrix_animations/gradient_up_down_anim.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN | 2 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN |
3 | 3 | ||
4 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 4 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
5 | extern rgb_config_t rgb_matrix_config; | 5 | extern rgb_config_t rgb_matrix_config; |
6 | 6 | ||
7 | bool rgb_matrix_gradient_up_down(effect_params_t* params) { | 7 | bool rgb_matrix_gradient_up_down(effect_params_t* params) { |
@@ -10,6 +10,7 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) { | |||
10 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 10 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
11 | uint8_t scale = scale8(64, rgb_matrix_config.speed); | 11 | uint8_t scale = scale8(64, rgb_matrix_config.speed); |
12 | for (uint8_t i = led_min; i < led_max; i++) { | 12 | for (uint8_t i = led_min; i < led_max; i++) { |
13 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
13 | point_t point = g_rgb_leds[i].point; | 14 | point_t point = g_rgb_leds[i].point; |
14 | // The y range will be 0..64, map this to 0..4 | 15 | // The y range will be 0..64, map this to 0..4 |
15 | // Relies on hue being 8-bit and wrapping | 16 | // Relies on hue being 8-bit and wrapping |
diff --git a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h index 01ff5c230..dffa53264 100644 --- a/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h +++ b/quantum/rgb_matrix_animations/jellybean_raindrops_anim.h | |||
@@ -2,10 +2,11 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS | 2 | #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | static void jellybean_raindrops_set_color(int i) { | 8 | static void jellybean_raindrops_set_color(int i, effect_params_t* params) { |
9 | if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; | ||
9 | HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; | 10 | HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val }; |
10 | RGB rgb = hsv_to_rgb(hsv); | 11 | RGB rgb = hsv_to_rgb(hsv); |
11 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 12 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
@@ -15,14 +16,14 @@ bool rgb_matrix_jellybean_raindrops(effect_params_t* params) { | |||
15 | if (!params->init) { | 16 | if (!params->init) { |
16 | // Change one LED every tick, make sure speed is not 0 | 17 | // Change one LED every tick, make sure speed is not 0 |
17 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { | 18 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) { |
18 | jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL); | 19 | jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); |
19 | } | 20 | } |
20 | return false; | 21 | return false; |
21 | } | 22 | } |
22 | 23 | ||
23 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 24 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
24 | for (int i = led_min; i < led_max; i++) { | 25 | for (int i = led_min; i < led_max; i++) { |
25 | jellybean_raindrops_set_color(i); | 26 | jellybean_raindrops_set_color(i, params); |
26 | } | 27 | } |
27 | return led_max < DRIVER_LED_TOTAL; | 28 | return led_max < DRIVER_LED_TOTAL; |
28 | } | 29 | } |
diff --git a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h index 3c15e64ab..89f6965c3 100644 --- a/quantum/rgb_matrix_animations/rainbow_beacon_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_beacon_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON | 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_rainbow_beacon(effect_params_t* params) { | 8 | bool rgb_matrix_rainbow_beacon(effect_params_t* params) { |
@@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) { | |||
13 | int16_t cos_value = 2 * (cos8(time) - 128); | 13 | int16_t cos_value = 2 * (cos8(time) - 128); |
14 | int16_t sin_value = 2 * (sin8(time) - 128); | 14 | int16_t sin_value = 2 * (sin8(time) - 128); |
15 | for (uint8_t i = led_min; i < led_max; i++) { | 15 | for (uint8_t i = led_min; i < led_max; i++) { |
16 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
16 | point_t point = g_rgb_leds[i].point; | 17 | point_t point = g_rgb_leds[i].point; |
17 | hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; | 18 | hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue; |
18 | RGB rgb = hsv_to_rgb(hsv); | 19 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h index 0d11d5280..0d57aef57 100644 --- a/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON | 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { | 8 | bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { |
@@ -11,6 +11,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) { | |||
11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; | 11 | HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val }; |
12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); | 12 | uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4); |
13 | for (uint8_t i = led_min; i < led_max; i++) { | 13 | for (uint8_t i = led_min; i < led_max; i++) { |
14 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
14 | point_t point = g_rgb_leds[i].point; | 15 | point_t point = g_rgb_leds[i].point; |
15 | hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; | 16 | hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue; |
16 | RGB rgb = hsv_to_rgb(hsv); | 17 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h index d7cd42cbe..03652758c 100644 --- a/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h +++ b/quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS | 2 | #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS |
3 | 3 | ||
4 | extern rgb_counters_t g_rgb_counters; | 4 | extern rgb_counters_t g_rgb_counters; |
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { | 8 | bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { |
@@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) { | |||
13 | int16_t cos_value = 3 * (cos8(time) - 128); | 13 | int16_t cos_value = 3 * (cos8(time) - 128); |
14 | int16_t sin_value = 3 * (sin8(time) - 128); | 14 | int16_t sin_value = 3 * (sin8(time) - 128); |
15 | for (uint8_t i = led_min; i < led_max; i++) { | 15 | for (uint8_t i = led_min; i < led_max; i++) { |
16 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
16 | point_t point = g_rgb_leds[i].point; | 17 | point_t point = g_rgb_leds[i].point; |
17 | hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; | 18 | hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue; |
18 | RGB rgb = hsv_to_rgb(hsv); | 19 | RGB rgb = hsv_to_rgb(hsv); |
diff --git a/quantum/rgb_matrix_animations/raindrops_anim.h b/quantum/rgb_matrix_animations/raindrops_anim.h index fc721375b..0e3a87864 100644 --- a/quantum/rgb_matrix_animations/raindrops_anim.h +++ b/quantum/rgb_matrix_animations/raindrops_anim.h | |||
@@ -5,7 +5,8 @@ | |||
5 | extern rgb_counters_t g_rgb_counters; | 5 | extern rgb_counters_t g_rgb_counters; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | 7 | ||
8 | static void raindrops_set_color(int i) { | 8 | static void raindrops_set_color(int i, effect_params_t* params) { |
9 | if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return; | ||
9 | HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; | 10 | HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val }; |
10 | 11 | ||
11 | // Take the shortest path between hues | 12 | // Take the shortest path between hues |
@@ -25,14 +26,14 @@ bool rgb_matrix_raindrops(effect_params_t* params) { | |||
25 | if (!params->init) { | 26 | if (!params->init) { |
26 | // Change one LED every tick, make sure speed is not 0 | 27 | // Change one LED every tick, make sure speed is not 0 |
27 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { | 28 | if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) { |
28 | raindrops_set_color(rand() % DRIVER_LED_TOTAL); | 29 | raindrops_set_color(rand() % DRIVER_LED_TOTAL, params); |
29 | } | 30 | } |
30 | return false; | 31 | return false; |
31 | } | 32 | } |
32 | 33 | ||
33 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | 34 | RGB_MATRIX_USE_LIMITS(led_min, led_max); |
34 | for (int i = led_min; i < led_max; i++) { | 35 | for (int i = led_min; i < led_max; i++) { |
35 | raindrops_set_color(i); | 36 | raindrops_set_color(i, params); |
36 | } | 37 | } |
37 | return led_max < DRIVER_LED_TOTAL; | 38 | return led_max < DRIVER_LED_TOTAL; |
38 | } | 39 | } |
diff --git a/quantum/rgb_matrix_animations/solid_color_anim.h b/quantum/rgb_matrix_animations/solid_color_anim.h index 24a197beb..033c1f933 100644 --- a/quantum/rgb_matrix_animations/solid_color_anim.h +++ b/quantum/rgb_matrix_animations/solid_color_anim.h | |||
@@ -8,6 +8,7 @@ bool rgb_matrix_solid_color(effect_params_t* params) { | |||
8 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; | 8 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val }; |
9 | RGB rgb = hsv_to_rgb(hsv); | 9 | RGB rgb = hsv_to_rgb(hsv); |
10 | for (uint8_t i = led_min; i < led_max; i++) { | 10 | for (uint8_t i = led_min; i < led_max; i++) { |
11 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
11 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | 12 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); |
12 | } | 13 | } |
13 | return led_max < DRIVER_LED_TOTAL; | 14 | return led_max < DRIVER_LED_TOTAL; |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_anim.h b/quantum/rgb_matrix_animations/solid_reactive_anim.h index 220e54233..836409dd6 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_anim.h | |||
@@ -13,6 +13,7 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) { | |||
13 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; | 13 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; |
14 | // Relies on hue being 8-bit and wrapping | 14 | // Relies on hue being 8-bit and wrapping |
15 | for (uint8_t i = led_min; i < led_max; i++) { | 15 | for (uint8_t i = led_min; i < led_max; i++) { |
16 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
16 | uint16_t tick = max_tick; | 17 | uint16_t tick = max_tick; |
17 | for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { | 18 | for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { |
18 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { | 19 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_cross.h b/quantum/rgb_matrix_animations/solid_reactive_cross.h index af602cba1..1dec1886d 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_cross.h +++ b/quantum/rgb_matrix_animations/solid_reactive_cross.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) | 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS) |
4 | 4 | ||
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
8 | 8 | ||
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par | |||
15 | hsv.v = 0; | 15 | hsv.v = 0; |
16 | point_t point = g_rgb_leds[i].point; | 16 | point_t point = g_rgb_leds[i].point; |
17 | for (uint8_t j = start; j < count; j++) { | 17 | for (uint8_t j = start; j < count; j++) { |
18 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
18 | int16_t dx = point.x - g_last_hit_tracker.x[j]; | 19 | int16_t dx = point.x - g_last_hit_tracker.x[j]; |
19 | int16_t dy = point.y - g_last_hit_tracker.y[j]; | 20 | int16_t dy = point.y - g_last_hit_tracker.y[j]; |
20 | uint8_t dist = sqrt16(dx * dx + dy * dy); | 21 | uint8_t dist = sqrt16(dx * dx + dy * dy); |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_nexus.h b/quantum/rgb_matrix_animations/solid_reactive_nexus.h index 8b4a139dc..8952a1e2b 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_nexus.h +++ b/quantum/rgb_matrix_animations/solid_reactive_nexus.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) |
4 | 4 | ||
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
8 | 8 | ||
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par | |||
15 | hsv.v = 0; | 15 | hsv.v = 0; |
16 | point_t point = g_rgb_leds[i].point; | 16 | point_t point = g_rgb_leds[i].point; |
17 | for (uint8_t j = start; j < count; j++) { | 17 | for (uint8_t j = start; j < count; j++) { |
18 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
18 | int16_t dx = point.x - g_last_hit_tracker.x[j]; | 19 | int16_t dx = point.x - g_last_hit_tracker.x[j]; |
19 | int16_t dy = point.y - g_last_hit_tracker.y[j]; | 20 | int16_t dy = point.y - g_last_hit_tracker.y[j]; |
20 | uint8_t dist = sqrt16(dx * dx + dy * dy); | 21 | uint8_t dist = sqrt16(dx * dx + dy * dy); |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h index e84cd6939..d7bdb414e 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h +++ b/quantum/rgb_matrix_animations/solid_reactive_simple_anim.h | |||
@@ -12,6 +12,7 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) { | |||
12 | // Max tick based on speed scale ensures results from scale16by8 with rgb_matrix_config.speed are no greater than 255 | 12 | // Max tick based on speed scale ensures results from scale16by8 with rgb_matrix_config.speed are no greater than 255 |
13 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; | 13 | uint16_t max_tick = 65535 / rgb_matrix_config.speed; |
14 | for (uint8_t i = led_min; i < led_max; i++) { | 14 | for (uint8_t i = led_min; i < led_max; i++) { |
15 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
15 | uint16_t tick = max_tick; | 16 | uint16_t tick = max_tick; |
16 | for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { | 17 | for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) { |
17 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { | 18 | if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) { |
diff --git a/quantum/rgb_matrix_animations/solid_reactive_wide.h b/quantum/rgb_matrix_animations/solid_reactive_wide.h index abb01892e..d86cb1284 100644 --- a/quantum/rgb_matrix_animations/solid_reactive_wide.h +++ b/quantum/rgb_matrix_animations/solid_reactive_wide.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) | 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE) |
4 | 4 | ||
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
8 | 8 | ||
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para | |||
15 | hsv.v = 0; | 15 | hsv.v = 0; |
16 | point_t point = g_rgb_leds[i].point; | 16 | point_t point = g_rgb_leds[i].point; |
17 | for (uint8_t j = start; j < count; j++) { | 17 | for (uint8_t j = start; j < count; j++) { |
18 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
18 | int16_t dx = point.x - g_last_hit_tracker.x[j]; | 19 | int16_t dx = point.x - g_last_hit_tracker.x[j]; |
19 | int16_t dy = point.y - g_last_hit_tracker.y[j]; | 20 | int16_t dy = point.y - g_last_hit_tracker.y[j]; |
20 | uint8_t dist = sqrt16(dx * dx + dy * dy); | 21 | uint8_t dist = sqrt16(dx * dx + dy * dy); |
diff --git a/quantum/rgb_matrix_animations/solid_splash_anim.h b/quantum/rgb_matrix_animations/solid_splash_anim.h index 82ac055b8..14312f33d 100644 --- a/quantum/rgb_matrix_animations/solid_splash_anim.h +++ b/quantum/rgb_matrix_animations/solid_splash_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) | 3 | #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH) |
4 | 4 | ||
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
8 | 8 | ||
@@ -12,6 +12,7 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p | |||
12 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; | 12 | HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 }; |
13 | uint8_t count = g_last_hit_tracker.count; | 13 | uint8_t count = g_last_hit_tracker.count; |
14 | for (uint8_t i = led_min; i < led_max; i++) { | 14 | for (uint8_t i = led_min; i < led_max; i++) { |
15 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
15 | hsv.v = 0; | 16 | hsv.v = 0; |
16 | point_t point = g_rgb_leds[i].point; | 17 | point_t point = g_rgb_leds[i].point; |
17 | for (uint8_t j = start; j < count; j++) { | 18 | for (uint8_t j = start; j < count; j++) { |
diff --git a/quantum/rgb_matrix_animations/splash_anim.h b/quantum/rgb_matrix_animations/splash_anim.h index 829d30eef..3c96d451e 100644 --- a/quantum/rgb_matrix_animations/splash_anim.h +++ b/quantum/rgb_matrix_animations/splash_anim.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | 2 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED |
3 | #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) | 3 | #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH) |
4 | 4 | ||
5 | extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; | 5 | extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL]; |
6 | extern rgb_config_t rgb_matrix_config; | 6 | extern rgb_config_t rgb_matrix_config; |
7 | extern last_hit_t g_last_hit_tracker; | 7 | extern last_hit_t g_last_hit_tracker; |
8 | 8 | ||
@@ -12,6 +12,7 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params) | |||
12 | HSV hsv = { 0, rgb_matrix_config.sat, 0 }; | 12 | HSV hsv = { 0, rgb_matrix_config.sat, 0 }; |
13 | uint8_t count = g_last_hit_tracker.count; | 13 | uint8_t count = g_last_hit_tracker.count; |
14 | for (uint8_t i = led_min; i < led_max; i++) { | 14 | for (uint8_t i = led_min; i < led_max; i++) { |
15 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
15 | hsv.h = rgb_matrix_config.hue; | 16 | hsv.h = rgb_matrix_config.hue; |
16 | hsv.v = 0; | 17 | hsv.v = 0; |
17 | point_t point = g_rgb_leds[i].point; | 18 | point_t point = g_rgb_leds[i].point; |
diff --git a/quantum/rgb_matrix_types.h b/quantum/rgb_matrix_types.h index 908e96da5..7a3bc6714 100644 --- a/quantum/rgb_matrix_types.h +++ b/quantum/rgb_matrix_types.h | |||
@@ -67,19 +67,21 @@ typedef union { | |||
67 | }; | 67 | }; |
68 | } matrix_co_t; | 68 | } matrix_co_t; |
69 | 69 | ||
70 | #define HAS_FLAGS(bits, flags) ((bits & flags) == flags) | ||
71 | #define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00) | ||
72 | |||
73 | #define LED_FLAG_ALL 0xFF | ||
74 | #define LED_FLAG_NONE 0x00 | ||
75 | #define LED_FLAG_MODIFIER 0x01 | ||
76 | #define LED_FLAG_UNDERGLOW 0x02 | ||
77 | #define LED_FLAG_KEYLIGHT 0x04 | ||
78 | |||
70 | typedef struct PACKED { | 79 | typedef struct PACKED { |
71 | matrix_co_t matrix_co; | 80 | matrix_co_t matrix_co; |
72 | point_t point; | 81 | point_t point; |
73 | uint8_t modifier:1; | 82 | uint8_t flags; |
74 | } rgb_led; | 83 | } rgb_led; |
75 | 84 | ||
76 | typedef enum { | ||
77 | RGB_ZONE_OFF = 0, | ||
78 | RGB_ZONE_ALL, | ||
79 | RGB_ZONE_KEYS, | ||
80 | RGB_ZONE_UNDER, | ||
81 | } rgb_zone_t; | ||
82 | |||
83 | typedef union { | 85 | typedef union { |
84 | uint32_t raw; | 86 | uint32_t raw; |
85 | struct PACKED { | 87 | struct PACKED { |