summaryrefslogtreecommitdiff
path: root/keyboards/wilba_tech/wt_rgb_backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/wilba_tech/wt_rgb_backlight.c')
-rw-r--r--keyboards/wilba_tech/wt_rgb_backlight.c231
1 files changed, 212 insertions, 19 deletions
diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c
index 92e14165ee..24d9d85ec0 100644
--- a/keyboards/wilba_tech/wt_rgb_backlight.c
+++ b/keyboards/wilba_tech/wt_rgb_backlight.c
@@ -18,7 +18,10 @@
defined(RGB_BACKLIGHT_ZEAL65) || \
defined(RGB_BACKLIGHT_M60_A) || \
defined(RGB_BACKLIGHT_M6_B) || \
+ defined(RGB_BACKLIGHT_M10_C) || \
defined(RGB_BACKLIGHT_KOYU) || \
+ defined(RGB_BACKLIGHT_M65_B) || \
+ defined(RGB_BACKLIGHT_M65_BX) || \
defined(RGB_BACKLIGHT_HS60) || \
defined(RGB_BACKLIGHT_NK65) || \
defined(RGB_BACKLIGHT_NEBULA12) || \
@@ -27,7 +30,8 @@
defined(RGB_BACKLIGHT_DAWN60) || \
defined(RGB_BACKLIGHT_WT60_B) || \
defined(RGB_BACKLIGHT_WT60_BX) || \
- defined(RGB_BACKLIGHT_WT60_C)
+ defined(RGB_BACKLIGHT_WT60_C) || \
+ defined(RGB_BACKLIGHT_M50_A)
#else
#error wt_rgb_backlight.c compiled without setting configuration symbol
#endif
@@ -87,6 +91,8 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL];
#define BACKLIGHT_LED_COUNT 84 //64 + 20
#elif defined(RGB_BACKLIGHT_NEBULA12)
#define BACKLIGHT_LED_COUNT 16
+#elif defined(RGB_BACKLIGHT_M10_C)
+#define BACKLIGHT_LED_COUNT 12
#else
#define BACKLIGHT_LED_COUNT 72
#endif
@@ -120,6 +126,8 @@ backlight_config g_config = {
RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 },
#if defined(RGB_BACKLIGHT_M6_B)
.custom_color = { { 0, 255 }, { 43, 255 }, { 85, 255 }, { 128, 255 }, { 171, 255 }, { 213, 255 } }
+#elif defined(RGB_BACKLIGHT_M10_C)
+ .custom_color = { { 0, 255 }, { 43, 255 }, { 85, 255 }, { 128, 255 }, { 171, 255 }, { 213, 255 }, { 0, 255 }, { 43, 255 }, { 85, 255 }, { 128, 255 } }
#endif
};
@@ -600,7 +608,29 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{1, C9_15, C8_15, C6_14}, //D15
{1, C9_16, C7_15, C6_15} //D16
};
-#elif !defined(RGB_BACKLIGHT_M6_B)
+#elif defined(RGB_BACKLIGHT_M6_B)
+ // Driver has fixed mapping of index to the red, green and blue LEDs
+#elif defined(RGB_BACKLIGHT_M10_C)
+// This is a 7-bit address, that gets left-shifted and bit 0
+// set to 0 for write, 1 for read (as per I2C protocol)
+#define ISSI_ADDR_1 0x74
+#define ISSI_ADDR_2
+
+const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
+ {0, C1_9, C3_10, C4_10}, // LB1
+ {0, C1_10, C2_10, C4_11}, // LB2
+ {0, C1_11, C2_11, C3_11}, // LB3
+ {0, C1_12, C2_12, C3_12}, // LB4
+ {0, C1_13, C2_13, C3_13}, // LB5
+ {0, C1_14, C2_14, C3_14}, // LB6
+ {0, C9_11, C8_11, C7_11}, // LB11
+ {0, C9_12, C8_12, C7_12}, // LB12
+ {0, C9_13, C8_13, C7_13}, // LB13
+ {0, C9_14, C8_14, C7_14}, // LB14
+ {0, C9_15, C8_15, C6_14}, // LB15
+ {0, C9_16, C7_15, C6_15} // LB16
+};
+#else
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
#define ISSI_ADDR_1 0x74
@@ -689,7 +719,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{1, C9_16, C7_15, C6_15}, // LD16
{1, C8_16, C7_16, C6_16}, // LD17
};
-#endif // !defined(RGB_BACKLIGHT_M6_B)
+#endif
typedef struct Point {
@@ -759,6 +789,35 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
{0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255},
{189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {207,238}, {211,255}, {218,255}, {255,255}
};
+#elif defined(RGB_BACKLIGHT_M65_B) || defined(RGB_BACKLIGHT_M65_BX)
+const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA0..LA17
+ {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32},
+ {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0},
+ // LB0..LB17
+ {144,0}, {160,0}, {176,0}, {192,0}, {208,0}, {224,0}, {216,0}, {240,0}, {240,16},
+ {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,32}, {240,48}, {240,64},
+ // LC0..LC17
+ {112,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {64,60}, {44,60}, {24,64},
+ {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {255,255}, {10,48}, {4,64},
+ // LD0..LD17
+ {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48},
+ {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {160,60}, {180,64}, {208,64}, {224,64}
+};
+const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA0..LA17
+ {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,243},
+ {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255},
+ // LB0..LB17
+ {56,255}, {51,255}, {46,255}, {42,255}, {38,255}, {35,255}, {37,255}, {32,255}, {19,255},
+ {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {0,255}, {237,255}, {224,255},
+ // LC0..LC17
+ {189,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {172,252}, {169,255}, {165,255},
+ {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {255,255}, {148,255}, {161,255},
+ // LD0..LD17
+ {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255},
+ {189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {207,238}, {211,255}, {218,255}, {221,255}
+};
#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A)
const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
// LA0..LA17
@@ -1010,6 +1069,24 @@ const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
{160,255}, {96,255}, {77,255}, {179,255}, {51,255}, {205,255}
};
+#elif defined(RGB_BACKLIGHT_M10_C)
+// M10-C is really simple:
+// 0 1 2
+// 3 4 5
+// 8 7 6
+// 11 10 9
+const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
+ {0,0}, {16,0}, {32,0},
+ {0,16}, {16,16}, {32,16},
+ {32,32}, {16,32}, {0,32},
+ {32,48}, {24,48}, {16,48}
+};
+const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
+ {160,255}, {192,255}, {224,255},
+ {128,255}, {0,0}, {0,255},
+ {32,255}, {64,255}, {96,255},
+ {45,255}, {54,255}, {64,255}
+};
#elif defined(RGB_BACKLIGHT_DAWN60)
const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
// LA1..LA16
@@ -1053,7 +1130,35 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
//11 - 20
{234,255}, {222,255}, {213,255}, {197,255}, {180,255}, {167,255}, {152,255}, {147,255}, {128,255}, {101,255}
};
-
+#elif defined(RGB_BACKLIGHT_M50_A)
+const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA0..LA17
+ {255,255}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {255,255}, {255,255},
+ {104,0}, {88,0}, {72,0}, {56,0}, {40,0}, {24,0}, {0,0}, {0,16}, {255,255},
+ // LB0..LB17
+ {255,255}, {120,0}, {136,0}, {152,0}, {168,0}, {184,0}, {200,0}, {255,255}, {255,255},
+ {120,16}, {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {255,255}, {255,255}, {255,255},
+ // LC0..LC17
+ {255,255}, {112,48}, {88,48}, {72,48}, {56,48}, {40,48}, {24,48}, {0,48}, {255,255},
+ {104,32}, {88,32}, {72,32}, {56,32}, {40,32}, {24,32}, {0,32}, {255,255}, {255,255},
+ // LD0..LD17
+ {255,255}, {120,32}, {136,32}, {152,32}, {168,32}, {184,32}, {200,32}, {255,255}, {255,255},
+ {255,255}, {136,48}, {152,48}, {168,48}, {184,48}, {200,48}, {255,255}, {255,255}, {255,255}
+};
+const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA0..LA17
+ {255,255}, {73,88}, {89,104}, {99,130}, {105,162}, {110,197}, {113,233}, {255,255}, {255,255},
+ {67,255}, {73,255}, {79,255}, {84,255}, {89,255}, {93,255}, {98,255}, {116,255}, {255,255},
+ // LB0..LB17
+ {0,0}, {61,255}, {55,255}, {49,255}, {44,255}, {39,255}, {35,255}, {255,255}, {255,255},
+ {55,88}, {39,104}, {29,130}, {23,162}, {18,197}, {15,233}, {255,255}, {255,255}, {255,255},
+ // LC0..LC17
+ {255,255}, {192,255}, {183,255}, {177,255}, {172,255}, {167,255}, {163,255}, {158,255}, {255,255},
+ {183,88}, {167,104}, {157,130}, {151,162}, {146,197}, {143,233}, {140,255}, {255,255}, {255,255},
+ // LD0..LD17
+ {255,255}, {201,88}, {217,104}, {227,130}, {233,162}, {238,197}, {241,233}, {255,255}, {255,255},
+ {255,255}, {201,255}, {207,255}, {212,255}, {217,255}, {221,255}, {255,255}, {255,255}, {255,255}
+};
#endif
// This may seem counter-intuitive, but it's quite flexible.
@@ -1067,7 +1172,7 @@ void map_led_to_point( uint8_t index, Point *point )
point->x = pgm_read_byte(addr);
point->y = pgm_read_byte(addr+1);
-#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65) || defined(RGB_BACKLIGHT_NEBULA12)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65) || defined(RGB_BACKLIGHT_NEBULA12)
return;
#endif
@@ -1177,6 +1282,22 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
{ 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 },
{ 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 18+17, 18+16 }
};
+#elif defined(RGB_BACKLIGHT_M65_B) || defined(RGB_BACKLIGHT_M65_BX)
+// Note: Left spacebar stab is at 4,4 (LC6)
+// Right spacebar stab is at 4,10 (D14)
+// (B6)
+// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B7
+// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B8
+// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B15
+// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B16
+// C17, C8, C7, C6, ---, ---, ---, C0, ---, ---, D14, D15, D16, D17, B17
+const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+ { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+7 },
+ { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+8 },
+ { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+15 },
+ { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+16 },
+ { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 54+17, 18+17 }
+};
#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A)
// Note: Left spacebar stab is at 4,3 (LC6)
// Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14)
@@ -1287,6 +1408,15 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
{ 0, 3, 5, 1, 2, 4 }
};
+#elif defined(RGB_BACKLIGHT_M10_C)
+// M10-C is really simple:
+// 0 1 2
+// 3 4 5
+// 8 7 6
+// 11 10 9
+const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+ { 0, 1, 2, 3, 4, 5, 8, 7, 6, 10 }
+};
#elif defined(RGB_BACKLIGHT_DAWN60)
//Dawn60
// A16, A15, A14, A13, A12, A11, A10, A9, B1, B2, B3, B4, B5, B6,
@@ -1300,6 +1430,16 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
{ -1+8 , 31+14, 31+13, 31+12, 31+11, 31+10, 31+9 , 47+1 , 47+2 , 47+3 , 47+4 , 47+5 , 15+8 , 15+7 },
{ 31+15, 31+5 , 31+4 , 31+3 , 31+2 , 31+1 , 47+9 , 47+10, 47+11, 47+12, 255 ,47+6 , 47+7 , 15+16},
{ 31+16, 31+8 , 31+7 , 255 , 255 , 31+6 , 255 , 255 , 255 , 47+13, 47+14, 47+15, 47+16, 47+8 }
+#elif defined(RGB_BACKLIGHT_M50_A)
+// LA15, LA14, LA13, LA12, LA11, LA10, LA9, LB1, LB2, LB3, LB4, LB5, LB6
+// LA16, LA6, LA5, LA4, LA3, LA2, LA1, LB9, LB10, LB11, LB12, LB13, LB14
+// LC15, LC14, LC13, LC12, LC11, LC10, LC9, LD1, LD2, LD3, LD4, LD5, LD6
+// LC7, LC6, LC5, LC4, LC3, LC2, LC1, ----, LD10, LD11, LD12, LD13, LD14
+const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+ { 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+1, 18+2, 18+3, 18+4, 18+5, 18+6 },
+ { 0+16, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14 },
+ { 36+15, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+1, 54+2, 54+3, 54+4, 54+5, 54+6 },
+ { 36+7, 36+6, 36+5, 36+4, 36+3, 36+2, 36+1, 255, 54+10, 54+11, 54+12, 54+13, 54+14 },
};
#endif
@@ -1316,6 +1456,9 @@ void backlight_update_pwm_buffers(void)
{
#if defined(RGB_BACKLIGHT_M6_B)
IS31FL3218_update_pwm_buffers();
+#elif defined(RGB_BACKLIGHT_M10_C)
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, 0 );
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 );
#elif defined(RGB_BACKLIGHT_HS60)
IS31FL3733_update_pwm_buffers( ISSI_ADDR_1, 0 );
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
@@ -1856,17 +1999,24 @@ void backlight_effect_cycle_radial2(void)
}
}
-#if defined(RGB_BACKLIGHT_M6_B)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C)
void backlight_effect_custom_colors(void)
{
RGB rgb;
- for ( uint8_t i = 0; i < 6; i++ )
+ for ( uint8_t i = 0; i < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT; i++ )
{
HSV hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness };
rgb = hsv_to_rgb( hsv );
uint8_t led;
map_row_column_to_led( 0, i, &led );
backlight_set_color( led, rgb.r, rgb.g, rgb.b );
+#if defined(RGB_BACKLIGHT_M10_C)
+ // Set stab LEDs with the same color
+ if ( led == 10 ) {
+ backlight_set_color( 9, rgb.r, rgb.g, rgb.b );
+ backlight_set_color( 11, rgb.r, rgb.g, rgb.b );
+ }
+#endif
}
}
#endif
@@ -1887,10 +2037,10 @@ void backlight_effect_indicators_set_colors( uint8_t index, HS color )
// do the same for the spacebar stabilizers
if ( index == 36+0 ) // LC0
{
-#if defined(RGB_BACKLIGHT_ZEAL65)
+#if defined(RGB_BACKLIGHT_ZEAL65)
backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7
backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14
-#elif defined(RGB_BACKLIGHT_KOYU)
+#elif defined(RGB_BACKLIGHT_KOYU) || defined(RGB_BACKLIGHT_M65_B) || defined(RGB_BACKLIGHT_M65_BX)
backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6
backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14
#elif defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_M60_A)
@@ -2008,7 +2158,7 @@ static void gpt_backlight_timer_task(GPTDriver *gptp)
backlight_effect_solid_color();
break;
case 2:
-#if defined(RGB_BACKLIGHT_M6_B)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C)
backlight_effect_custom_colors();
#else
backlight_effect_alphas_mods();
@@ -2045,7 +2195,7 @@ static void gpt_backlight_timer_task(GPTDriver *gptp)
if ( ! suspend_backlight )
{
-#if !defined(RGB_BACKLIGHT_M6_B)
+#if !defined(RGB_BACKLIGHT_M6_B) && !defined(RGB_BACKLIGHT_M10_C)
backlight_effect_indicators();
#endif
}
@@ -2231,11 +2381,11 @@ void backlight_config_set_value( uint8_t *data )
g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) );
}
}
-#if defined(RGB_BACKLIGHT_M6_B)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C)
case id_custom_color:
{
uint8_t index = value_data[0];
- if ( index >= 0 && index <= 6 )
+ if ( index >= 0 && index < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT )
{
_set_color( &(g_config.custom_color[index]), &(value_data[1]) );
}
@@ -2368,11 +2518,11 @@ void backlight_config_get_value( uint8_t *data )
*(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF;
}
}
-#if defined(RGB_BACKLIGHT_M6_B)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C)
case id_custom_color:
{
uint8_t index = value_data[0];
- if ( index >= 0 && index <= 6 )
+ if ( index >= 0 && index < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT )
{
_get_color( &(g_config.custom_color[index]), &(value_data[1]) );
}
@@ -2459,10 +2609,13 @@ void backlight_init_drivers(void)
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 );
#else
+ // Init the #1 driver
IS31FL3731_init( ISSI_ADDR_1 );
-#if !defined(RGB_BACKLIGHT_NEBULA12)
+ // Init the #2 driver (if used)
+#if !defined(RGB_BACKLIGHT_NEBULA12) && !defined(RGB_BACKLIGHT_M10_C)
IS31FL3731_init( ISSI_ADDR_2 );
#endif
+ // Init the #3 driver (if used)
#if defined(RGB_BACKLIGHT_U80_A)
IS31FL3731_init( ISSI_ADDR_3 );
#endif
@@ -2484,6 +2637,15 @@ void backlight_init_drivers(void)
bool enabled = !( ( index == 36+15 ) || // LC15
( index == 54+13 ) || // LD13
( index == 54+17 ) ); // LD17
+#elif defined(RGB_BACKLIGHT_M65_B) || defined(RGB_BACKLIGHT_M65_BX)
+ bool enabled = !(
+ // LB6 not present on M65-B
+#if defined(RGB_BACKLIGHT_M65_B)
+ ( index == 18+6 ) || // LB6
+#endif
+ // LC15 LD13 not present on M65-B, M65-BX
+ ( index == 36+15 ) || // LC15
+ ( index == 54+13 ) ); // LD13
#elif defined(RGB_BACKLIGHT_M60_A)
bool enabled = !(
// LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A
@@ -2550,19 +2712,50 @@ void backlight_init_drivers(void)
( index == 47+15 && g_config.use_7u_spacebar ) ); //LD15
#elif defined(RGB_BACKLIGHT_NEBULA12)
bool enabled = !( ( index >= 9-1 && index <= 12-1 ) ); // A9-A12
+#elif defined(RGB_BACKLIGHT_M50_A)
+ bool enabled = !(
+ // LA0, LA7, LA8, LA17
+ ( index == 0+0 ) ||
+ ( index == 0+7 ) ||
+ ( index == 0+8 ) ||
+ ( index == 0+17 ) ||
+
+ // LB0, LB7, LB8, LB15, LB16, LB17,
+ ( index == 18+0 ) ||
+ ( index == 18+7 ) ||
+ ( index == 18+8 ) ||
+ ( index == 18+15 ) ||
+ ( index == 18+16 ) ||
+ ( index == 18+17 ) ||
+ // LC0, LC8, LC16, LC17
+ ( index == 36+0 ) ||
+ ( index == 36+8 ) ||
+ ( index == 36+16 ) ||
+ ( index == 36+17 ) ||
+ // LD0, LD7, LD8, LD9, LD15, LD16, LD17
+ ( index == 54+0 ) ||
+ ( index == 54+7 ) ||
+ ( index == 54+8 ) ||
+ ( index == 54+9 ) ||
+ ( index == 54+15 ) ||
+ ( index == 54+16 ) ||
+ ( index == 54+17 ) );
+#elif defined(RGB_BACKLIGHT_M10_C)
+ bool enabled = true;
#endif
// This only caches it for later
IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
}
// This actually updates the LED drivers
+ // TODO: refactor this to use DRIVER_COUNT
IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 );
-#if !defined(RGB_BACKLIGHT_NEBULA12)
+#if !defined(RGB_BACKLIGHT_NEBULA12) && !defined(RGB_BACKLIGHT_M10_C)
IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 );
#endif
-#if defined(RGB_BACKLIGHT_U80_A)
+#if defined(RGB_BACKLIGHT_U80_A)
IS31FL3731_update_led_control_registers( ISSI_ADDR_3, 2 );
#endif
-#endif // !defined(RGB_BACKLIGHT_M6_B)
+#endif
// TODO: put the 1 second startup delay here?