From b52aca0af83fade24c56b4bb7369f18183123bd3 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 1 Nov 2023 11:53:45 +1100 Subject: Relocate LED driver init code (#22365) --- keyboards/kprepublic/bm60hsrgb/rev2/config.h | 4 ++-- keyboards/kprepublic/bm60hsrgb/rev2/rev2.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'keyboards/kprepublic/bm60hsrgb') diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/config.h b/keyboards/kprepublic/bm60hsrgb/rev2/config.h index 9349838622..8d194f5ccb 100644 --- a/keyboards/kprepublic/bm60hsrgb/rev2/config.h +++ b/keyboards/kprepublic/bm60hsrgb/rev2/config.h @@ -74,7 +74,7 @@ #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 -#define ISSI_LED_TOTAL DRIVER_1_LED_TOTAL +#define IS31FL3733_LED_COUNT DRIVER_1_LED_TOTAL // Underglow LEDs are WS2812, but someone might want to use RGBLIGHT for them; // don't use those LEDs in RGB Matrix in that case. @@ -84,7 +84,7 @@ # define WS2812_LED_TOTAL 6 #endif -#define RGB_MATRIX_LED_COUNT (ISSI_LED_TOTAL + WS2812_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (IS31FL3733_LED_COUNT + WS2812_LED_TOTAL) #ifdef RGB_MATRIX_ENABLE # define RGB_MATRIX_KEYPRESSES diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c index 8b786d7cfb..0e9b3d318d 100644 --- a/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c @@ -22,7 +22,7 @@ # include "is31fl3733.h" # include "ws2812.h" -const is31fl3733_led_t PROGMEM g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = { +const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { { 0, B_1, A_1, C_1 }, { 0, B_2, A_2, C_2 }, { 0, B_3, A_3, C_3 }, @@ -153,8 +153,8 @@ rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_TOTAL]; static void rgb_matrix_driver_init(void) { i2c_init(); - is31fl3733_init(IS31FL3733_I2C_ADDRESS_1, 0); - for (uint8_t index = 0; index < ISSI_LED_TOTAL; index++) { + is31fl3733_init(IS31FL3733_I2C_ADDRESS_1, IS31FL3733_SYNC_NONE); + for (uint8_t index = 0; index < IS31FL3733_LED_COUNT; index++) { bool enabled = true; is31fl3733_set_led_control_register(index, enabled, enabled, enabled); } @@ -169,13 +169,13 @@ static void rgb_matrix_driver_flush(void) { } static void rgb_matrix_driver_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - if (index < ISSI_LED_TOTAL) { + if (index < IS31FL3733_LED_COUNT) { is31fl3733_set_color(index, red, green, blue); } else { # if WS2812_LED_TOTAL > 0 - rgb_matrix_ws2812_array[index - ISSI_LED_TOTAL].r = red; - rgb_matrix_ws2812_array[index - ISSI_LED_TOTAL].g = green; - rgb_matrix_ws2812_array[index - ISSI_LED_TOTAL].b = blue; + rgb_matrix_ws2812_array[index - IS31FL3733_LED_COUNT].r = red; + rgb_matrix_ws2812_array[index - IS31FL3733_LED_COUNT].g = green; + rgb_matrix_ws2812_array[index - IS31FL3733_LED_COUNT].b = blue; # endif } } -- cgit v1.2.3