diff options
author | Ryan <fauxpark@gmail.com> | 2022-09-23 22:46:23 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-23 22:46:23 +1000 |
commit | 36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 (patch) | |
tree | 4e75c5fc5cd31d9fdc904876906c0b409ee45d90 /quantum | |
parent | d967de0df749f3be63403e07feda416ea09351d0 (diff) |
Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399)
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/led_matrix/led_matrix.c | 8 | ||||
-rw-r--r-- | quantum/led_matrix/led_matrix.h | 16 | ||||
-rw-r--r-- | quantum/led_matrix/led_matrix_drivers.c | 2 | ||||
-rw-r--r-- | quantum/led_matrix/led_matrix_types.h | 4 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/jellybean_raindrops_anim.h | 2 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/pixel_flow_anim.h | 4 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/pixel_rain_anim.h | 2 | ||||
-rw-r--r-- | quantum/rgb_matrix/animations/raindrops_anim.h | 2 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.c | 8 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix.h | 16 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix_drivers.c | 6 | ||||
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix_types.h | 4 |
12 files changed, 37 insertions, 37 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index 14dd0dd48a..5bff154480 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -170,7 +170,7 @@ void led_matrix_set_value(int index, uint8_t value) { void led_matrix_set_value_all(uint8_t value) { #if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) + for (uint8_t i = 0; i < LED_MATRIX_LED_COUNT; i++) led_matrix_set_value(i, value); #else # ifdef USE_CIE1931_CURVE @@ -399,13 +399,13 @@ void led_matrix_indicators_advanced(effect_params_t *params) { * and not sure which would be better. Otherwise, this should be called from * led_task_render, right before the iter++ line. */ -#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL +#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < LED_MATRIX_LED_COUNT uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * (params->iter - 1); uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; + if (max > LED_MATRIX_LED_COUNT) max = LED_MATRIX_LED_COUNT; #else uint8_t min = 0; - uint8_t max = DRIVER_LED_TOTAL; + uint8_t max = LED_MATRIX_LED_COUNT; #endif led_matrix_indicators_advanced_kb(min, max); led_matrix_indicators_advanced_user(min, max); diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index 446f293c78..db4f223d5b 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h @@ -42,15 +42,15 @@ #endif #ifndef LED_MATRIX_LED_PROCESS_LIMIT -# define LED_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 +# define LED_MATRIX_LED_PROCESS_LIMIT (LED_MATRIX_LED_COUNT + 4) / 5 #endif -#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < DRIVER_LED_TOTAL +#if defined(LED_MATRIX_LED_PROCESS_LIMIT) && LED_MATRIX_LED_PROCESS_LIMIT > 0 && LED_MATRIX_LED_PROCESS_LIMIT < LED_MATRIX_LED_COUNT # if defined(LED_MATRIX_SPLIT) # define LED_MATRIX_USE_LIMITS(min, max) \ uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * params->iter; \ uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; \ + if (max > LED_MATRIX_LED_COUNT) max = LED_MATRIX_LED_COUNT; \ uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; \ if (is_keyboard_left() && (max > k_led_matrix_split[0])) max = k_led_matrix_split[0]; \ if (!(is_keyboard_left()) && (min < k_led_matrix_split[0])) min = k_led_matrix_split[0]; @@ -58,20 +58,20 @@ # define LED_MATRIX_USE_LIMITS(min, max) \ uint8_t min = LED_MATRIX_LED_PROCESS_LIMIT * params->iter; \ uint8_t max = min + LED_MATRIX_LED_PROCESS_LIMIT; \ - if (max > DRIVER_LED_TOTAL) max = DRIVER_LED_TOTAL; + if (max > LED_MATRIX_LED_COUNT) max = LED_MATRIX_LED_COUNT; # endif #else # if defined(LED_MATRIX_SPLIT) # define LED_MATRIX_USE_LIMITS(min, max) \ uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; \ + uint8_t max = LED_MATRIX_LED_COUNT; \ const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; \ if (is_keyboard_left() && (max > k_led_matrix_split[0])) max = k_led_matrix_split[0]; \ if (!(is_keyboard_left()) && (min < k_led_matrix_split[0])) min = k_led_matrix_split[0]; # else # define LED_MATRIX_USE_LIMITS(min, max) \ uint8_t min = 0; \ - uint8_t max = DRIVER_LED_TOTAL; + uint8_t max = LED_MATRIX_LED_COUNT; # endif #endif @@ -181,9 +181,9 @@ static inline bool led_matrix_check_finished_leds(uint8_t led_idx) { uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; return led_idx < k_led_matrix_split[0]; } else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < LED_MATRIX_LED_COUNT; #else - return led_idx < DRIVER_LED_TOTAL; + return led_idx < LED_MATRIX_LED_COUNT; #endif } diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c index f01b395c15..2c09ba82b1 100644 --- a/quantum/led_matrix/led_matrix_drivers.c +++ b/quantum/led_matrix/led_matrix_drivers.c @@ -96,7 +96,7 @@ static void init(void) { # endif # endif - for (int index = 0; index < DRIVER_LED_TOTAL; index++) { + for (int index = 0; index < LED_MATRIX_LED_COUNT; index++) { # if defined(IS31FL3731) IS31FL3731_set_led_control_register(index, true); # elif defined(IS31FL3733) diff --git a/quantum/led_matrix/led_matrix_types.h b/quantum/led_matrix/led_matrix_types.h index 3dc533100f..6d79a3592d 100644 --- a/quantum/led_matrix/led_matrix_types.h +++ b/quantum/led_matrix/led_matrix_types.h @@ -76,8 +76,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[LED_MATRIX_LED_COUNT]; + uint8_t flags[LED_MATRIX_LED_COUNT]; } led_config_t; typedef union { 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 { |