summaryrefslogtreecommitdiff
path: root/keyboards/xelus/dawn60
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-11-01 11:53:45 +1100
committerGitHub <noreply@github.com>2023-11-01 00:53:45 +0000
commitb52aca0af83fade24c56b4bb7369f18183123bd3 (patch)
tree9b553c4b771717cc334f3c8683052bc701472c4d /keyboards/xelus/dawn60
parenteac8e6788871a087eafdc5492eee425a7205d727 (diff)
Relocate LED driver init code (#22365)
Diffstat (limited to 'keyboards/xelus/dawn60')
-rw-r--r--keyboards/xelus/dawn60/rev1/config.h2
-rw-r--r--keyboards/xelus/dawn60/rev1_qmk/config.h4
-rw-r--r--keyboards/xelus/dawn60/rev1_qmk/rev1_qmk.c34
3 files changed, 9 insertions, 31 deletions
diff --git a/keyboards/xelus/dawn60/rev1/config.h b/keyboards/xelus/dawn60/rev1/config.h
index c7945df3d6..a2a127f0a4 100644
--- a/keyboards/xelus/dawn60/rev1/config.h
+++ b/keyboards/xelus/dawn60/rev1/config.h
@@ -19,7 +19,7 @@
#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND
#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA
#define IS31FL3731_DRIVER_COUNT 2
-#define RGB_MATRIX_LED_COUNT 64
+#define IS31FL3731_LED_COUNT 64
// Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap
#define LOCKING_SUPPORT_ENABLE
diff --git a/keyboards/xelus/dawn60/rev1_qmk/config.h b/keyboards/xelus/dawn60/rev1_qmk/config.h
index 33629a8ef3..e0ffe30843 100644
--- a/keyboards/xelus/dawn60/rev1_qmk/config.h
+++ b/keyboards/xelus/dawn60/rev1_qmk/config.h
@@ -30,8 +30,8 @@
#define IS31FL3731_DRIVER_COUNT 2
#define DRIVER_1_LED_TOTAL 32
#define DRIVER_2_LED_TOTAL 32
-#define ISSI_DRIVER_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
-#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL + WS2812_LED_TOTAL)
+#define IS31FL3731_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
+#define RGB_MATRIX_LED_COUNT (IS31FL3731_LED_COUNT + WS2812_LED_TOTAL)
#define RGB_MATRIX_DEFAULT_VAL 80
#define RGB_MATRIX_KEYPRESSES
diff --git a/keyboards/xelus/dawn60/rev1_qmk/rev1_qmk.c b/keyboards/xelus/dawn60/rev1_qmk/rev1_qmk.c
index da83d358b9..35ac5a06b2 100644
--- a/keyboards/xelus/dawn60/rev1_qmk/rev1_qmk.c
+++ b/keyboards/xelus/dawn60/rev1_qmk/rev1_qmk.c
@@ -25,7 +25,7 @@
#ifdef RGB_MATRIX_ENABLE
rgb_led_t rgb_matrix_ws2812_array[WS2812_LED_TOTAL];
-const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
+const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@@ -99,28 +99,6 @@ const is31fl3731_led_t PROGMEM g_is31fl3731_leds[RGB_MATRIX_LED_COUNT] = {
{1, C9_14, C8_14, C7_14}, //D14
{1, C9_15, C8_15, C6_14}, //D15
{1, C9_16, C7_15, C6_15}, //D16
-
- //fake underglows 1- 20
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0},
- {2, 0, 0, 0}
};
__attribute__ ((weak))
@@ -169,7 +147,7 @@ static void init(void) {
i2c_init();
is31fl3731_init(IS31FL3731_I2C_ADDRESS_1);
is31fl3731_init(IS31FL3731_I2C_ADDRESS_2);
- for (int index = 0; index < ISSI_DRIVER_TOTAL; index++) {
+ for (int index = 0; index < IS31FL3731_LED_COUNT; index++) {
bool enabled = true;
is31fl3731_set_led_control_register(index, enabled, enabled, enabled);
}
@@ -187,12 +165,12 @@ static void flush(void) {
}
static void set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
- if (index < ISSI_DRIVER_TOTAL) {
+ if (index < IS31FL3731_LED_COUNT) {
is31fl3731_set_color(index, red, green, blue);
} else {
- rgb_matrix_ws2812_array[index - ISSI_DRIVER_TOTAL].r = red;
- rgb_matrix_ws2812_array[index - ISSI_DRIVER_TOTAL].g = green;
- rgb_matrix_ws2812_array[index - ISSI_DRIVER_TOTAL].b = blue;
+ rgb_matrix_ws2812_array[index - IS31FL3731_LED_COUNT].r = red;
+ rgb_matrix_ws2812_array[index - IS31FL3731_LED_COUNT].g = green;
+ rgb_matrix_ws2812_array[index - IS31FL3731_LED_COUNT].b = blue;
}
}