From 4cde11550c3843f378bdb19e7c205558ad62d371 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 13 Jun 2020 23:52:21 -0700 Subject: [PATCH 1/3] Change `led` to `led_matrix` in rgb_matrix_drivers Is a minor change that only affects the driver file. However, this will allow somebody to run rgblight along side rgb matrix using the ws2812 driver, as well. Specifically, so you can use the custom driver for rgblight to set a different pin (barring a change to the `ws2812_setleds` function). Courtesy of discord conversion: https://discordapp.com/channels/440868230475677696/568161140534935572/721555623191248906 --- quantum/rgb_matrix_drivers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index ea41b0d3962f..ac4418cfd324 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -98,27 +98,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = { #elif defined(WS2812) // LED color buffer -LED_TYPE led[DRIVER_LED_TOTAL]; +LED_TYPE led_matrix[DRIVER_LED_TOTAL]; static void init(void) {} static void flush(void) { // Assumes use of RGB_DI_PIN - ws2812_setleds(led, DRIVER_LED_TOTAL); + ws2812_setleds(led_matrix, DRIVER_LED_TOTAL); } // Set an led in the buffer to a color static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { - led[i].r = r; - led[i].g = g; - led[i].b = b; + led_matrix[i].r = r; + led_matrix[i].g = g; + led_matrix[i].b = b; # ifdef RGBW - convert_rgb_to_rgbw(led[i]); + convert_rgb_to_rgbw(led_matrix[i]); # endif } static void setled_all(uint8_t r, uint8_t g, uint8_t b) { - for (int i = 0; i < sizeof(led) / sizeof(led[0]); i++) { + for (int i = 0; i < sizeof(led_matrix) / sizeof(led_matrix[0]); i++) { setled(i, r, g, b); } } From 691c1e921cfb8a187d2dc3ac46da4846d804eec6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 15 Jun 2020 01:52:15 -0700 Subject: [PATCH 2/3] Change name to be super specific --- quantum/rgb_matrix_drivers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index ac4418cfd324..ea6b1d762689 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -98,27 +98,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = { #elif defined(WS2812) // LED color buffer -LED_TYPE led_matrix[DRIVER_LED_TOTAL]; +LED_TYPE ws2812_led_array[DRIVER_LED_TOTAL]; static void init(void) {} static void flush(void) { // Assumes use of RGB_DI_PIN - ws2812_setleds(led_matrix, DRIVER_LED_TOTAL); + ws2812_setleds(ws2812_led_array, DRIVER_LED_TOTAL); } // Set an led in the buffer to a color static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { - led_matrix[i].r = r; - led_matrix[i].g = g; - led_matrix[i].b = b; + ws2812_led_array[i].r = r; + ws2812_led_array[i].g = g; + ws2812_led_array[i].b = b; # ifdef RGBW - convert_rgb_to_rgbw(led_matrix[i]); + convert_rgb_to_rgbw(ws2812_led_array[i]); # endif } static void setled_all(uint8_t r, uint8_t g, uint8_t b) { - for (int i = 0; i < sizeof(led_matrix) / sizeof(led_matrix[0]); i++) { + for (int i = 0; i < sizeof(ws2812_led_array) / sizeof(ws2812_led_array[0]); i++) { setled(i, r, g, b); } } From 9e368c34e122743d95385822a83de0beb0505163 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 19 Jun 2020 18:30:44 -0700 Subject: [PATCH 3/3] Update rgb_matrix_drivers.c --- quantum/rgb_matrix_drivers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index ea6b1d762689..a176e2081a49 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -98,27 +98,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = { #elif defined(WS2812) // LED color buffer -LED_TYPE ws2812_led_array[DRIVER_LED_TOTAL]; +LED_TYPE rgb_matrix_ws2812_array[DRIVER_LED_TOTAL]; static void init(void) {} static void flush(void) { // Assumes use of RGB_DI_PIN - ws2812_setleds(ws2812_led_array, DRIVER_LED_TOTAL); + ws2812_setleds(rgb_matrix_ws2812_array, DRIVER_LED_TOTAL); } // Set an led in the buffer to a color static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) { - ws2812_led_array[i].r = r; - ws2812_led_array[i].g = g; - ws2812_led_array[i].b = b; + rgb_matrix_ws2812_array[i].r = r; + rgb_matrix_ws2812_array[i].g = g; + rgb_matrix_ws2812_array[i].b = b; # ifdef RGBW - convert_rgb_to_rgbw(ws2812_led_array[i]); + 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 < sizeof(ws2812_led_array) / sizeof(ws2812_led_array[0]); i++) { + for (int i = 0; i < sizeof(rgb_matrix_ws2812_array) / sizeof(rgb_matrix_ws2812_array[0]); i++) { setled(i, r, g, b); } }