Skip to content

Commit

Permalink
Fix right side ws2812 leds having two indices (#15985)
Browse files Browse the repository at this point in the history
* Fix right side leds having two indices

* remove redundant left check
  • Loading branch information
daskygit authored Feb 11, 2022
1 parent 7148a69 commit 00cc646
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions quantum/rgb_matrix/rgb_matrix_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 00cc646

Please sign in to comment.