summaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-09-23 22:46:23 +1000
committerGitHub <noreply@github.com>2022-09-23 22:46:23 +1000
commit36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 (patch)
tree4e75c5fc5cd31d9fdc904876906c0b409ee45d90 /quantum/rgb_matrix
parentd967de0df749f3be63403e07feda416ea09351d0 (diff)
Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399)
Diffstat (limited to 'quantum/rgb_matrix')
-rw-r--r--quantum/rgb_matrix/animations/jellybean_raindrops_anim.h2
-rw-r--r--quantum/rgb_matrix/animations/pixel_flow_anim.h4
-rw-r--r--quantum/rgb_matrix/animations/pixel_rain_anim.h2
-rw-r--r--quantum/rgb_matrix/animations/raindrops_anim.h2
-rw-r--r--quantum/rgb_matrix/rgb_matrix.c8
-rw-r--r--quantum/rgb_matrix/rgb_matrix.h16
-rw-r--r--quantum/rgb_matrix/rgb_matrix_drivers.c6
-rw-r--r--quantum/rgb_matrix/rgb_matrix_types.h4
8 files changed, 22 insertions, 22 deletions
diff --git a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h
index 31dffcbc5a..69bf265d14 100644
--- a/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h
+++ b/quantum/rgb_matrix/animations/jellybean_raindrops_anim.h
@@ -13,7 +13,7 @@ bool JELLYBEAN_RAINDROPS(effect_params_t* params) {
if (!params->init) {
// Change one LED every tick, make sure speed is not 0
if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) {
- jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params);
+ jellybean_raindrops_set_color(rand() % RGB_MATRIX_LED_COUNT, params);
}
return false;
}
diff --git a/quantum/rgb_matrix/animations/pixel_flow_anim.h b/quantum/rgb_matrix/animations/pixel_flow_anim.h
index 714f5d174e..8628c3c2ec 100644
--- a/quantum/rgb_matrix/animations/pixel_flow_anim.h
+++ b/quantum/rgb_matrix/animations/pixel_flow_anim.h
@@ -7,7 +7,7 @@ RGB_MATRIX_EFFECT(PIXEL_FLOW)
static bool PIXEL_FLOW(effect_params_t* params) {
// LED state array
- static RGB led[DRIVER_LED_TOTAL];
+ static RGB led[RGB_MATRIX_LED_COUNT];
static uint32_t wait_timer = 0;
if (wait_timer > g_rgb_timer) {
@@ -21,7 +21,7 @@ static bool PIXEL_FLOW(effect_params_t* params) {
if (params->init) {
// Clear LEDs and fill the state array
rgb_matrix_set_color_all(0, 0, 0);
- for (uint8_t j = 0; j < DRIVER_LED_TOTAL; ++j) {
+ for (uint8_t j = 0; j < RGB_MATRIX_LED_COUNT; ++j) {
led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v});
}
}
diff --git a/quantum/rgb_matrix/animations/pixel_rain_anim.h b/quantum/rgb_matrix/animations/pixel_rain_anim.h
index ce2528a26d..fded60340f 100644
--- a/quantum/rgb_matrix/animations/pixel_rain_anim.h
+++ b/quantum/rgb_matrix/animations/pixel_rain_anim.h
@@ -41,7 +41,7 @@ static bool PIXEL_RAIN(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
if (g_rgb_timer > wait_timer) {
- rain_pixel(mod8(random8(), DRIVER_LED_TOTAL), params, random8() & 2);
+ rain_pixel(mod8(random8(), RGB_MATRIX_LED_COUNT), params, random8() & 2);
}
return rgb_matrix_check_finished_leds(led_max);
}
diff --git a/quantum/rgb_matrix/animations/raindrops_anim.h b/quantum/rgb_matrix/animations/raindrops_anim.h
index a508e51183..6b92d649ad 100644
--- a/quantum/rgb_matrix/animations/raindrops_anim.h
+++ b/quantum/rgb_matrix/animations/raindrops_anim.h
@@ -24,7 +24,7 @@ bool RAINDROPS(effect_params_t* params) {
if (!params->init) {
// Change one LED every tick, make sure speed is not 0
if (scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) {
- raindrops_set_color(random8() % DRIVER_LED_TOTAL, params);
+ raindrops_set_color(random8() % RGB_MATRIX_LED_COUNT, params);
}
} else {
for (int i = led_min; i < led_max; i++) {
diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c
index 2730686839..ae61e75535 100644
--- a/quantum/rgb_matrix/rgb_matrix.c
+++ b/quantum/rgb_matrix/rgb_matrix.c
@@ -202,7 +202,7 @@ void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
- for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++)
+ for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; i++)
rgb_matrix_set_color(i, red, green, blue);
#else
rgb_matrix_driver.set_color_all(red, green, blue);
@@ -461,13 +461,13 @@ void rgb_matrix_indicators_advanced(effect_params_t *params) {
* and not sure which would be better. Otherwise, this should be called from
* rgb_task_render, right before the iter++ line.
*/
-#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL
+#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < RGB_MATRIX_LED_COUNT
uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * (params->iter - 1);
uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT;
- if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL;
+ if (max > RGB_MATRIX_LED_COUNT) max = RGB_MATRIX_LED_COUNT;
#else
uint8_t min = 0;
- uint8_t max = DRIVER_LED_TOTAL;
+ uint8_t max = RGB_MATRIX_LED_COUNT;
#endif
rgb_matrix_indicators_advanced_kb(min, max);
rgb_matrix_indicators_advanced_user(min, max);
diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h
index fc9fc3e020..0b35e98f45 100644
--- a/quantum/rgb_matrix/rgb_matrix.h
+++ b/quantum/rgb_matrix/rgb_matrix.h
@@ -47,15 +47,15 @@
#endif
#ifndef RGB_MATRIX_LED_PROCESS_LIMIT
-# define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5
+# define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5
#endif
-#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL
+#if defined(RGB_MATRIX_LED_PROCESS_LIMIT) && RGB_MATRIX_LED_PROCESS_LIMIT > 0 && RGB_MATRIX_LED_PROCESS_LIMIT < RGB_MATRIX_LED_COUNT
# if defined(RGB_MATRIX_SPLIT)
# define RGB_MATRIX_USE_LIMITS(min, max) \
uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; \
uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; \
- if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; \
+ if (max > RGB_MATRIX_LED_COUNT) max = RGB_MATRIX_LED_COUNT; \
uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; \
if (is_keyboard_left() && (max > k_rgb_matrix_split[0])) max = k_rgb_matrix_split[0]; \
if (!(is_keyboard_left()) && (min < k_rgb_matrix_split[0])) min = k_rgb_matrix_split[0];
@@ -63,20 +63,20 @@
# define RGB_MATRIX_USE_LIMITS(min, max) \
uint8_t min = RGB_MATRIX_LED_PROCESS_LIMIT * params->iter; \
uint8_t max = min + RGB_MATRIX_LED_PROCESS_LIMIT; \
- if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL;
+ if (max > RGB_MATRIX_LED_COUNT) max = RGB_MATRIX_LED_COUNT;
# endif
#else
# if defined(RGB_MATRIX_SPLIT)
# define RGB_MATRIX_USE_LIMITS(min, max) \
uint8_t min = 0; \
- uint8_t max = DRIVER_LED_TOTAL; \
+ uint8_t max = RGB_MATRIX_LED_COUNT; \
const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; \
if (is_keyboard_left() && (max > k_rgb_matrix_split[0])) max = k_rgb_matrix_split[0]; \
if (!(is_keyboard_left()) && (min < k_rgb_matrix_split[0])) min = k_rgb_matrix_split[0];
# else
# define RGB_MATRIX_USE_LIMITS(min, max) \
uint8_t min = 0; \
- uint8_t max = DRIVER_LED_TOTAL;
+ uint8_t max = RGB_MATRIX_LED_COUNT;
# endif
#endif
@@ -246,9 +246,9 @@ static inline bool rgb_matrix_check_finished_leds(uint8_t led_idx) {
uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT;
return led_idx < k_rgb_matrix_split[0];
} else
- return led_idx < DRIVER_LED_TOTAL;
+ return led_idx < RGB_MATRIX_LED_COUNT;
#else
- return led_idx < DRIVER_LED_TOTAL;
+ return led_idx < RGB_MATRIX_LED_COUNT;
#endif
}
diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c
index 99151e5a92..e75b2c6c9d 100644
--- a/quantum/rgb_matrix/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix/rgb_matrix_drivers.c
@@ -106,7 +106,7 @@ static void init(void) {
# endif
# endif
- for (int index = 0; index < DRIVER_LED_TOTAL; index++) {
+ for (int index = 0; index < RGB_MATRIX_LED_COUNT; index++) {
bool enabled = true;
// This only caches it for later
@@ -336,13 +336,13 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
# endif
// LED color buffer
-LED_TYPE rgb_matrix_ws2812_array[DRIVER_LED_TOTAL];
+LED_TYPE rgb_matrix_ws2812_array[RGB_MATRIX_LED_COUNT];
static void init(void) {}
static void flush(void) {
// Assumes use of RGB_DI_PIN
- ws2812_setleds(rgb_matrix_ws2812_array, DRIVER_LED_TOTAL);
+ ws2812_setleds(rgb_matrix_ws2812_array, RGB_MATRIX_LED_COUNT);
}
// Set an led in the buffer to a color
diff --git a/quantum/rgb_matrix/rgb_matrix_types.h b/quantum/rgb_matrix/rgb_matrix_types.h
index d0ac4e4466..eea603c41c 100644
--- a/quantum/rgb_matrix/rgb_matrix_types.h
+++ b/quantum/rgb_matrix/rgb_matrix_types.h
@@ -78,8 +78,8 @@ typedef struct PACKED {
typedef struct PACKED {
uint8_t matrix_co[MATRIX_ROWS][MATRIX_COLS];
- led_point_t point[DRIVER_LED_TOTAL];
- uint8_t flags[DRIVER_LED_TOTAL];
+ led_point_t point[RGB_MATRIX_LED_COUNT];
+ uint8_t flags[RGB_MATRIX_LED_COUNT];
} led_config_t;
typedef union {