Skip to content

Commit

Permalink
Reinstate global k_rgb_matrix_split (#24388)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored Sep 15, 2024
1 parent d48aac6 commit e84104f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 2 additions & 4 deletions quantum/led_matrix/led_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
11 changes: 7 additions & 4 deletions quantum/rgb_matrix/rgb_matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e84104f

Please sign in to comment.