diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index 798ab9a120..a5f0296f8d 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -387,7 +387,6 @@ struct led_matrix_limits_t led_matrix_get_limits(uint8_t iter) { limits.led_min_index = LED_MATRIX_LED_PROCESS_LIMIT * (iter); limits.led_max_index = limits.led_min_index + LED_MATRIX_LED_PROCESS_LIMIT; if (limits.led_max_index > LED_MATRIX_LED_COUNT) limits.led_max_index = LED_MATRIX_LED_COUNT; - uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; if (is_keyboard_left() && (limits.led_max_index > k_led_matrix_split[0])) limits.led_max_index = k_led_matrix_split[0]; if (!(is_keyboard_left()) && (limits.led_min_index < k_led_matrix_split[0])) limits.led_min_index = k_led_matrix_split[0]; # else @@ -397,9 +396,8 @@ struct led_matrix_limits_t led_matrix_get_limits(uint8_t iter) { # endif #else # if defined(LED_MATRIX_SPLIT) - limits.led_min_index = 0; - limits.led_max_index = LED_MATRIX_LED_COUNT; - const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; + limits.led_min_index = 0; + limits.led_max_index = LED_MATRIX_LED_COUNT; if (is_keyboard_left() && (limits.led_max_index > k_led_matrix_split[0])) limits.led_max_index = k_led_matrix_split[0]; if (!(is_keyboard_left()) && (limits.led_min_index < k_led_matrix_split[0])) limits.led_min_index = k_led_matrix_split[0]; # else diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index 4d55a3d5fe..0ea421d1c5 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c @@ -83,6 +83,11 @@ static uint32_t rgb_timer_buffer; static last_hit_t last_hit_buffer; #endif // RGB_MATRIX_KEYREACTIVE_ENABLED +// split rgb matrix +#if defined(RGB_MATRIX_SPLIT) +const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; +#endif + EECONFIG_DEBOUNCE_HELPER(rgb_matrix, EECONFIG_RGB_MATRIX, rgb_matrix_config); void eeconfig_update_rgb_matrix(void) { @@ -399,7 +404,6 @@ struct rgb_matrix_limits_t rgb_matrix_get_limits(uint8_t iter) { limits.led_min_index = RGB_MATRIX_LED_PROCESS_LIMIT * (iter); limits.led_max_index = limits.led_min_index + RGB_MATRIX_LED_PROCESS_LIMIT; if (limits.led_max_index > RGB_MATRIX_LED_COUNT) limits.led_max_index = RGB_MATRIX_LED_COUNT; - uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; if (is_keyboard_left() && (limits.led_max_index > k_rgb_matrix_split[0])) limits.led_max_index = k_rgb_matrix_split[0]; if (!(is_keyboard_left()) && (limits.led_min_index < k_rgb_matrix_split[0])) limits.led_min_index = k_rgb_matrix_split[0]; # else @@ -409,9 +413,8 @@ struct rgb_matrix_limits_t rgb_matrix_get_limits(uint8_t iter) { # endif #else # if defined(RGB_MATRIX_SPLIT) - limits.led_min_index = 0; - limits.led_max_index = RGB_MATRIX_LED_COUNT; - const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; + limits.led_min_index = 0; + limits.led_max_index = RGB_MATRIX_LED_COUNT; if (is_keyboard_left() && (limits.led_max_index > k_rgb_matrix_split[0])) limits.led_max_index = k_rgb_matrix_split[0]; if (!(is_keyboard_left()) && (limits.led_min_index < k_rgb_matrix_split[0])) limits.led_min_index = k_rgb_matrix_split[0]; # else