aboutsummaryrefslogtreecommitdiff
path: root/keyboards/rgbkb/pan/pan.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/rgbkb/pan/pan.c')
-rw-r--r--keyboards/rgbkb/pan/pan.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/keyboards/rgbkb/pan/pan.c b/keyboards/rgbkb/pan/pan.c
index 401831e0e2..20cc4dd248 100644
--- a/keyboards/rgbkb/pan/pan.c
+++ b/keyboards/rgbkb/pan/pan.c
@@ -21,43 +21,23 @@
# if defined(KEYBOARD_rgbkb_pan_rev1)
# include "ws2812.h"
-// LED color buffer
-rgb_led_t rgb_matrix_ws2812_array[RGB_MATRIX_LED_COUNT];
-
-static void flush(void) {
- ws2812_setleds(rgb_matrix_ws2812_array, RGB_MATRIX_LED_COUNT);
-}
-
// Set an led in the buffer to a color
static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) {
# if defined(RGB_ENCODERS) || defined(STAGGERED_RGB_ENCODERS)
if (i == 0 || i == 1) { // if encoder LEDs, change LEDs
- rgb_matrix_ws2812_array[i].r = g;
- rgb_matrix_ws2812_array[i].g = b;
- rgb_matrix_ws2812_array[i].b = r;
+ ws2812_set_color(i, g, b, r);
} else
# endif
{
- rgb_matrix_ws2812_array[i].r = r;
- rgb_matrix_ws2812_array[i].g = g;
- rgb_matrix_ws2812_array[i].b = b;
- }
-# ifdef WS2812_RGBW
- convert_rgb_to_rgbw(&rgb_matrix_ws2812_array[i]);
-# endif
-}
-
-static void setled_all(uint8_t r, uint8_t g, uint8_t b) {
- for (int i = 0; i < ARRAY_SIZE(rgb_matrix_ws2812_array); i++) {
- setled(i, r, g, b);
+ ws2812_set_color(i, r, g, b);
}
}
const rgb_matrix_driver_t rgb_matrix_driver = {
.init = ws2812_init,
- .flush = flush,
+ .flush = ws2812_flush,
.set_color = setled,
- .set_color_all = setled_all,
+ .set_color_all = ws2812_set_color_all,
};
# endif