From 36c410592dbd35da33ccc5fd6d2a5cbf4b25a708 Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 23 Sep 2022 22:46:23 +1000 Subject: Change `DRIVER_LED_COUNT` to `{LED,RGB}_MATRIX_LED_COUNT` (#18399) --- keyboards/annepro2/rgb_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/annepro2/rgb_driver.c') diff --git a/keyboards/annepro2/rgb_driver.c b/keyboards/annepro2/rgb_driver.c index 1040e89f98..f1d2a3cd13 100644 --- a/keyboards/annepro2/rgb_driver.c +++ b/keyboards/annepro2/rgb_driver.c @@ -19,7 +19,7 @@ #include "rgb_matrix.h" #include "ap2_led.h" -uint8_t led_pos[DRIVER_LED_TOTAL]; +uint8_t led_pos[RGB_MATRIX_LED_COUNT]; void init(void) { unsigned int i = 0; @@ -52,7 +52,7 @@ void set_color(int index, uint8_t r, uint8_t g, uint8_t b) { } void set_color_all(uint8_t r, uint8_t g, uint8_t b) { - for (int i=0; i Date: Sat, 8 Oct 2022 16:04:16 -0500 Subject: AnnePro2: Adjust RGB flushing (#18640) --- keyboards/annepro2/rgb_driver.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'keyboards/annepro2/rgb_driver.c') diff --git a/keyboards/annepro2/rgb_driver.c b/keyboards/annepro2/rgb_driver.c index f1d2a3cd13..d12fcea90a 100644 --- a/keyboards/annepro2/rgb_driver.c +++ b/keyboards/annepro2/rgb_driver.c @@ -16,8 +16,8 @@ #ifdef RGB_MATRIX_ENABLE -#include "rgb_matrix.h" -#include "ap2_led.h" +# include "rgb_matrix.h" +# include "ap2_led.h" uint8_t led_pos[RGB_MATRIX_LED_COUNT]; @@ -33,26 +33,22 @@ void init(void) { } } -void flush(void) {} +void flush(void) { + for (uint8_t row = 0; row < NUM_ROW; row++) + ap2_led_colors_set_row(row); +} void set_color(int index, uint8_t r, uint8_t g, uint8_t b) { - if (r != led_colors[led_pos[index]].p.red || - g != led_colors[led_pos[index]].p.green || - b != led_colors[led_pos[index]].p.blue) - { - led_colors[led_pos[index]] = (ap2_led_t){ - .p.blue = b, - .p.red = r, - .p.green = g, - .p.alpha = 0xff, - }; - int row = led_pos[index] / NUM_COLUMN; - rgb_row_changed[row] = 1; - } + led_colors[led_pos[index]] = (ap2_led_t){ + .p.blue = b, + .p.red = r, + .p.green = g, + .p.alpha = 0xff, + }; } void set_color_all(uint8_t r, uint8_t g, uint8_t b) { - for (int i=0; i