diff options
author | Dasky <32983009+daskygit@users.noreply.github.com> | 2022-02-11 20:13:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 20:13:22 +0000 |
commit | 00cc64638c7ffa90b1acc10c420daaa3795a87ba (patch) | |
tree | 01a0648f524dcc32456216462e2117166d8873cc | |
parent | 7148a69d5ea7d75119c81cf9b7c579f3136c4fd3 (diff) | |
download | qmk_firmware-00cc64638c7ffa90b1acc10c420daaa3795a87ba.tar.gz qmk_firmware-00cc64638c7ffa90b1acc10c420daaa3795a87ba.zip |
Fix right side ws2812 leds having two indices (#15985)
* Fix right side leds having two indices
* remove redundant left check
-rw-r--r-- | quantum/rgb_matrix/rgb_matrix_drivers.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index bdd512d1c2..27fa7369bf 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -349,10 +349,15 @@ 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]; - } else if (is_keyboard_left() && (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 (i >= k_rgb_matrix_split[0]) { return; + } # endif rgb_matrix_ws2812_array[i].r = r; |