From 59187d855f762b3d32b6d7176bd5fc02c070c343 Mon Sep 17 00:00:00 2001 From: daskygit <32983009+daskygit@users.noreply.github.com> Date: Sat, 22 Jan 2022 04:17:46 +0000 Subject: [PATCH 1/2] Fix right side leds having two indices --- quantum/rgb_matrix/rgb_matrix_drivers.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 130ca47a6394..ad7054a42ee9 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -299,8 +299,12 @@ static void flush(void) { static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { # if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; - if (!is_keyboard_left() && (i >= k_rgb_matrix_split[0])) { - i -= k_rgb_matrix_split[0]; + if (!is_keyboard_left()) { + if (i >= k_rgb_matrix_split[0]) { + i -= k_rgb_matrix_split[0]; + } else { + return; + } } else if (is_keyboard_left() && (i >= k_rgb_matrix_split[0])) return; # endif From dab629da5995ac4737f1a9269b7eb22d5346a54c Mon Sep 17 00:00:00 2001 From: daskygit <32983009+daskygit@users.noreply.github.com> Date: Sat, 22 Jan 2022 05:47:26 +0000 Subject: [PATCH 2/2] remove redundant left check --- quantum/rgb_matrix/rgb_matrix_drivers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index ad7054a42ee9..cc29a5d85f13 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -305,8 +305,9 @@ static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { } else { return; } - } else if (is_keyboard_left() && (i >= k_rgb_matrix_split[0])) + } else if (i >= k_rgb_matrix_split[0]) { return; + } # endif rgb_matrix_ws2812_array[i].r = r;