diff options
author | Ryan <fauxpark@gmail.com> | 2023-11-01 11:53:45 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 00:53:45 +0000 |
commit | b52aca0af83fade24c56b4bb7369f18183123bd3 (patch) | |
tree | 9b553c4b771717cc334f3c8683052bc701472c4d /keyboards/kprepublic/bm60hsrgb_iso/rev2 | |
parent | eac8e6788871a087eafdc5492eee425a7205d727 (diff) |
Relocate LED driver init code (#22365)
Diffstat (limited to 'keyboards/kprepublic/bm60hsrgb_iso/rev2')
-rw-r--r-- | keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h | 4 | ||||
-rw-r--r-- | keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h b/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h index acd30f0659..b22c384460 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h @@ -82,7 +82,7 @@ // IS31FL3733+WS2812 driver setup used by this board the LED controller drivers // are compiled unconditionally). -#define ISSI_LED_TOTAL DRIVER_1_LED_TOTAL +#define IS31FL3733_LED_COUNT DRIVER_1_LED_TOTAL #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 180 @@ -94,7 +94,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_iso/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c index 02dd4ab6ce..2cfe18e08e 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c @@ -24,7 +24,7 @@ # include "ws2812.h" -const PROGMEM is31fl3733_led_t g_is31fl3733_leds[RGB_MATRIX_LED_COUNT] = { +const PROGMEM is31fl3733_led_t 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 } } |