|
@@ -13,11 +13,10 @@
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/
|
|
|
-#if RGB_BACKLIGHT_ENABLED
|
|
|
|
|
|
-#if defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) || defined(RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_KOYU) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65)
|
|
|
+#if defined(RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) || defined(RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_KOYU) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_U80_A)
|
|
|
#else
|
|
|
-#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B, RGB_BACKLIGHT_KOYU, RGB_BACKLIGHT_HS60, RGB_BACKLIGHT_NK65
|
|
|
+#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B, RGB_BACKLIGHT_KOYU, RGB_BACKLIGHT_HS60, RGB_BACKLIGHT_NK65, RGB_BACKLIGHT_U80_A
|
|
|
#endif
|
|
|
|
|
|
#ifndef MAX
|
|
@@ -29,9 +28,9 @@
|
|
|
#endif
|
|
|
|
|
|
#include "quantum.h"
|
|
|
-#include "rgb_backlight.h"
|
|
|
-#include "rgb_backlight_api.h"
|
|
|
-#include "rgb_backlight_keycodes.h"
|
|
|
+#include "wt_rgb_backlight.h"
|
|
|
+#include "wt_rgb_backlight_api.h"
|
|
|
+#include "wt_rgb_backlight_keycodes.h"
|
|
|
|
|
|
#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65)
|
|
|
#include <avr/io.h>
|
|
@@ -58,8 +57,12 @@
|
|
|
#define BACKLIGHT_LED_COUNT 69
|
|
|
#else
|
|
|
#include "drivers/issi/is31fl3731.h"
|
|
|
+#if defined(RGB_BACKLIGHT_U80_A)
|
|
|
+#define BACKLIGHT_LED_COUNT 108
|
|
|
+#else
|
|
|
#define BACKLIGHT_LED_COUNT 72
|
|
|
#endif
|
|
|
+#endif
|
|
|
|
|
|
#define BACKLIGHT_EFFECT_MAX 10
|
|
|
|
|
@@ -330,6 +333,134 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|
|
{1, K_16, J_16, L_16}, //LB64
|
|
|
};
|
|
|
|
|
|
+#elif defined(RGB_BACKLIGHT_U80_A)
|
|
|
+
|
|
|
+// U80-A prototype uses 3 ISSI drivers
|
|
|
+#define ISSI_ADDR_1 0x74 // 11101[00] <- GND
|
|
|
+#define ISSI_ADDR_2 0x76 // 11101[10] <- SDA
|
|
|
+#define ISSI_ADDR_3 0x75 // 11101[01] <- SCL
|
|
|
+
|
|
|
+const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|
|
+/* Refer to IS31 manual for these locations
|
|
|
+ * driver
|
|
|
+ * | R location
|
|
|
+ * | | G location
|
|
|
+ * | | | B location
|
|
|
+ * | | | | */
|
|
|
+ {0, C2_1, C3_1, C4_1}, // LA0
|
|
|
+ {0, C1_1, C3_2, C4_2}, // LA1
|
|
|
+ {0, C1_2, C2_2, C4_3}, // LA2
|
|
|
+ {0, C1_3, C2_3, C3_3}, // LA3
|
|
|
+ {0, C1_4, C2_4, C3_4}, // LA4
|
|
|
+ {0, C1_5, C2_5, C3_5}, // LA5
|
|
|
+ {0, C1_6, C2_6, C3_6}, // LA6
|
|
|
+ {0, C1_7, C2_7, C3_7}, // LA7
|
|
|
+ {0, C1_8, C2_8, C3_8}, // LA8
|
|
|
+ {0, C9_1, C8_1, C7_1}, // LA9
|
|
|
+ {0, C9_2, C8_2, C7_2}, // LA10
|
|
|
+ {0, C9_3, C8_3, C7_3}, // LA11
|
|
|
+ {0, C9_4, C8_4, C7_4}, // LA12
|
|
|
+ {0, C9_5, C8_5, C7_5}, // LA13
|
|
|
+ {0, C9_6, C8_6, C7_6}, // LA14
|
|
|
+ {0, C9_7, C8_7, C6_6}, // LA15
|
|
|
+ {0, C9_8, C7_7, C6_7}, // LA16
|
|
|
+ {0, C8_8, C7_8, C6_8}, // LA17
|
|
|
+
|
|
|
+ {0, C2_9, C3_9, C4_9}, // LB0
|
|
|
+ {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, C1_15, C2_15, C3_15}, // LB7
|
|
|
+ {0, C1_16, C2_16, C3_16}, // LB8
|
|
|
+ {0, C9_9, C8_9, C7_9}, // LB9
|
|
|
+ {0, C9_10, C8_10, C7_10}, // LB10
|
|
|
+ {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
|
|
|
+ {0, C8_16, C7_16, C6_16}, // LB17
|
|
|
+
|
|
|
+ {1, C2_1, C3_1, C4_1}, // LC0
|
|
|
+ {1, C1_1, C3_2, C4_2}, // LC1
|
|
|
+ {1, C1_2, C2_2, C4_3}, // LC2
|
|
|
+ {1, C1_3, C2_3, C3_3}, // LC3
|
|
|
+ {1, C1_4, C2_4, C3_4}, // LC4
|
|
|
+ {1, C1_5, C2_5, C3_5}, // LC5
|
|
|
+ {1, C1_6, C2_6, C3_6}, // LC6
|
|
|
+ {1, C1_7, C2_7, C3_7}, // LC7
|
|
|
+ {1, C1_8, C2_8, C3_8}, // LC8
|
|
|
+ {1, C9_1, C8_1, C7_1}, // LC9
|
|
|
+ {1, C9_2, C8_2, C7_2}, // LC10
|
|
|
+ {1, C9_3, C8_3, C7_3}, // LC11
|
|
|
+ {1, C9_4, C8_4, C7_4}, // LC12
|
|
|
+ {1, C9_5, C8_5, C7_5}, // LC13
|
|
|
+ {1, C9_6, C8_6, C7_6}, // LC14
|
|
|
+ {1, C9_7, C8_7, C6_6}, // LC15
|
|
|
+ {1, C9_8, C7_7, C6_7}, // LC16
|
|
|
+ {1, C8_8, C7_8, C6_8}, // LC17
|
|
|
+
|
|
|
+ {1, C2_9, C3_9, C4_9}, // LD0
|
|
|
+ {1, C1_9, C3_10, C4_10}, // LD1
|
|
|
+ {1, C1_10, C2_10, C4_11}, // LD2
|
|
|
+ {1, C1_11, C2_11, C3_11}, // LD3
|
|
|
+ {1, C1_12, C2_12, C3_12}, // LD4
|
|
|
+ {1, C1_13, C2_13, C3_13}, // LD5
|
|
|
+ {1, C1_14, C2_14, C3_14}, // LD6
|
|
|
+ {1, C1_15, C2_15, C3_15}, // LD7
|
|
|
+ {1, C1_16, C2_16, C3_16}, // LD8
|
|
|
+ {1, C9_9, C8_9, C7_9}, // LD9
|
|
|
+ {1, C9_10, C8_10, C7_10}, // LD10
|
|
|
+ {1, C9_11, C8_11, C7_11}, // LD11
|
|
|
+ {1, C9_12, C8_12, C7_12}, // LD12
|
|
|
+ {1, C9_13, C8_13, C7_13}, // LD13
|
|
|
+ {1, C9_14, C8_14, C7_14}, // LD14
|
|
|
+ {1, C9_15, C8_15, C6_14}, // LD15
|
|
|
+ {1, C9_16, C7_15, C6_15}, // LD16
|
|
|
+ {1, C8_16, C7_16, C6_16}, // LD17
|
|
|
+
|
|
|
+ {2, C2_1, C3_1, C4_1}, // LE0
|
|
|
+ {2, C1_1, C3_2, C4_2}, // LE1
|
|
|
+ {2, C1_2, C2_2, C4_3}, // LE2
|
|
|
+ {2, C1_3, C2_3, C3_3}, // LE3
|
|
|
+ {2, C1_4, C2_4, C3_4}, // LE4
|
|
|
+ {2, C1_5, C2_5, C3_5}, // LE5
|
|
|
+ {2, C1_6, C2_6, C3_6}, // LE6
|
|
|
+ {2, C1_7, C2_7, C3_7}, // LE7
|
|
|
+ {2, C1_8, C2_8, C3_8}, // LE8
|
|
|
+ {2, C9_1, C8_1, C7_1}, // LE9
|
|
|
+ {2, C9_2, C8_2, C7_2}, // LE10
|
|
|
+ {2, C9_3, C8_3, C7_3}, // LE11
|
|
|
+ {2, C9_4, C8_4, C7_4}, // LE12
|
|
|
+ {2, C9_5, C8_5, C7_5}, // LE13
|
|
|
+ {2, C9_6, C8_6, C7_6}, // LE14
|
|
|
+ {2, C9_7, C8_7, C6_6}, // LE15
|
|
|
+ {2, C9_8, C7_7, C6_7}, // LE16
|
|
|
+ {2, C8_8, C7_8, C6_8}, // LE17
|
|
|
+
|
|
|
+ {2, C2_9, C3_9, C4_9}, // LF0
|
|
|
+ {2, C1_9, C3_10, C4_10}, // LF1
|
|
|
+ {2, C1_10, C2_10, C4_11}, // LF2
|
|
|
+ {2, C1_11, C2_11, C3_11}, // LF3
|
|
|
+ {2, C1_12, C2_12, C3_12}, // LF4
|
|
|
+ {2, C1_13, C2_13, C3_13}, // LF5
|
|
|
+ {2, C1_14, C2_14, C3_14}, // LF6
|
|
|
+ {2, C1_15, C2_15, C3_15}, // LF7
|
|
|
+ {2, C1_16, C2_16, C3_16}, // LF8
|
|
|
+ {2, C9_9, C8_9, C7_9}, // LF9
|
|
|
+ {2, C9_10, C8_10, C7_10}, // LF10
|
|
|
+ {2, C9_11, C8_11, C7_11}, // LF11
|
|
|
+ {2, C9_12, C8_12, C7_12}, // LF12
|
|
|
+ {2, C9_13, C8_13, C7_13}, // LF13
|
|
|
+ {2, C9_14, C8_14, C7_14}, // LF14
|
|
|
+ {2, C9_15, C8_15, C6_14}, // LF15
|
|
|
+ {2, C9_16, C7_15, C6_15}, // LF16
|
|
|
+ {2, C8_16, C7_16, C6_16}, // LF17
|
|
|
+};
|
|
|
#elif !defined(RGB_BACKLIGHT_M6_B)
|
|
|
// 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)
|
|
@@ -506,8 +637,8 @@ const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
};
|
|
|
const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
// LA0..LA17
|
|
|
- {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, {58,255},
|
|
|
- {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255},
|
|
|
+ {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247},
|
|
|
+ {58,255}, {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255},
|
|
|
// LB0..LB17
|
|
|
{53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,255}, {255,255}, {255,255},
|
|
|
{48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {255,255}, {255,255}, {255,255},
|
|
@@ -518,6 +649,48 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
{0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255},
|
|
|
{195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255}
|
|
|
};
|
|
|
+#elif defined(RGB_BACKLIGHT_U80_A)
|
|
|
+const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
+ // Thse are scaled by 14.5 per U
|
|
|
+ // LA0..LA17
|
|
|
+ {109,36}, {94,36}, {80,36}, {65,36}, {51,36}, {36,36}, {22,36}, {4,36}, {5,51},
|
|
|
+ {116,22}, {102,22}, {87,22}, {73,22}, {58,22}, {44,22}, {29,22}, {15,22}, {0,22},
|
|
|
+ // LB0..LB17
|
|
|
+ {131,22}, {145,22}, {160,22}, {174,22}, {196,22}, {0,0}, {0,0}, {0,0}, {0,0},
|
|
|
+ {123,36}, {138,36}, {152,36}, {167,36}, {181,36}, {199,36}, {0,0}, {0,0}, {0,0},
|
|
|
+ // LC0..LC17
|
|
|
+ {102,80}, {91,65}, {76,65}, {62,65}, {47,65}, {33,65}, {58,76}, {40,80}, {22,80},
|
|
|
+ {98,51}, {83,51}, {69,51}, {54,51}, {40,51}, {25,51}, {0,0}, {9,65}, {4,80},
|
|
|
+ // LD0..LD17
|
|
|
+ {112,51}, {127,51}, {141,51}, {156,51}, {170,51}, {194,51}, {163,65}, {190,65}, {0,0},
|
|
|
+ {105,65}, {120,65}, {134,65}, {149,65}, {0,0}, {145,76}, {163,80}, {181,80}, {199,80},
|
|
|
+ // LE0..LE17
|
|
|
+ {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0},
|
|
|
+ {73,0}, {94,0}, {109,0}, {123,0}, {138,0}, {58,0}, {44,0}, {29,0}, {0,0},
|
|
|
+ // LF0..LF17
|
|
|
+ {160,0}, {174,0}, {189,0}, {203,0}, {225,0}, {239,0}, {254,0}, {254,22}, {254,36},
|
|
|
+ {239,22}, {239,36}, {225,22}, {225,36}, {0,0}, {239,65}, {225,80}, {239,80}, {254,80}
|
|
|
+};
|
|
|
+const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
+ // LA0..LA17
|
|
|
+ {59,129}, {69,129}, {80,138}, {88,154}, {95,175}, {100,200}, {104,227}, {107,255}, {128,226},
|
|
|
+ {59,255}, {64,255}, {69,255}, {75,255}, {80,255}, {84,255}, {88,255}, {91,255}, {95,255},
|
|
|
+ // LB0..LB17
|
|
|
+ {53,255}, {48,255}, {44,255}, {40,255}, {35,255}, {255,255}, {255,255}, {255,255}, {255,255},
|
|
|
+ {48,138}, {40,154}, {33,175}, {28,200}, {24,227}, {21,255}, {255,255}, {255,255}, {255,255},
|
|
|
+ // LC0..LC17
|
|
|
+ {192,255}, {184,131}, {174,141}, {166,159}, {160,181}, {155,207}, {174,244}, {171,255}, {166,255},
|
|
|
+ {128,9}, {128,43}, {128,77}, {128,111}, {128,145}, {128,179}, {255,255}, {150,252}, {162,255},
|
|
|
+ // LD0..LD17
|
|
|
+ {0,26}, {0,60}, {0,94}, {0,128}, {0,162}, {0,218}, {227,193}, {234,245}, {255,255},
|
|
|
+ {195,128}, {205,135}, {214,149}, {221,169}, {255,255}, {210,244}, {213,255}, {218,255}, {222,255},
|
|
|
+ // LE0..LE17
|
|
|
+ {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255}, {255,255},
|
|
|
+ {70,255}, {66,255}, {62,255}, {59,255}, {56,255}, {73,255}, {76,255}, {79,255}, {84,255},
|
|
|
+ // LF0..LF17
|
|
|
+ {52,255}, {49,255}, {47,255}, {44,255}, {41,255}, {38,255}, {37,255}, {25,255}, {14,255},
|
|
|
+ {27,255}, {15,255}, {29,255}, {17,255}, {255,255}, {241,255}, {227,255}, {229,255}, {231,255}
|
|
|
+};
|
|
|
#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_ANSI)
|
|
|
const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
|
|
|
// LA1..LA47
|
|
@@ -745,6 +918,17 @@ 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 },
|
|
|
{ 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 }
|
|
|
};
|
|
|
+#elif defined(RGB_BACKLIGHT_U80_A)
|
|
|
+// Note: Left spacebar stab is at 5,3 (LC6)
|
|
|
+// Right spacebar stab is at 5,10 (LD14)
|
|
|
+const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
|
|
|
+ { 72+17, 72+16, 72+15, 72+14, 72+9, 72+10, 72+11, 72+12, 72+13, 90+0, 90+1, 90+2, 90+3, 255, 90+4, 90+5, 90+6 },
|
|
|
+ { 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, 90+11, 90+9, 90+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, 90+12, 90+10, 90+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, 255, 255, 255, 255 },
|
|
|
+ { 36+16, 255, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 255, 255, 90+14, 255 },
|
|
|
+ { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 54+17, 90+15, 90+16, 90+17 }
|
|
|
+};
|
|
|
#elif defined(RGB_BACKLIGHT_HS60) && defined(HS60_ANSI)
|
|
|
//
|
|
|
// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53,
|
|
@@ -831,9 +1015,29 @@ void backlight_update_pwm_buffers(void)
|
|
|
IS31FL3733_update_pwm_buffers( ISSI_ADDR_2, 1 );
|
|
|
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
|
|
|
IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 );
|
|
|
+#elif defined(RGB_BACKLIGHT_U80_A)
|
|
|
+ static uint8_t driver = 0;
|
|
|
+ switch ( driver )
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, 0 );
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_2, 1 );
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_3, 2 );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if ( ++driver > 2 )
|
|
|
+ {
|
|
|
+ driver = 0;
|
|
|
+ }
|
|
|
#else
|
|
|
- IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, ISSI_ADDR_2 );
|
|
|
- IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 );
|
|
|
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, 0 );
|
|
|
+ IS31FL3731_update_pwm_buffers( ISSI_ADDR_2, 1 );
|
|
|
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 );
|
|
|
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 );
|
|
|
#endif
|
|
|
}
|
|
|
|
|
@@ -1028,7 +1232,7 @@ void backlight_effect_alphas_mods(void)
|
|
|
{
|
|
|
RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } );
|
|
|
RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } );
|
|
|
-
|
|
|
+ bool is_alpha = false;
|
|
|
for ( int row = 0; row < MATRIX_ROWS; row++ )
|
|
|
{
|
|
|
for ( int column = 0; column < MATRIX_COLS; column++ )
|
|
@@ -1037,7 +1241,19 @@ void backlight_effect_alphas_mods(void)
|
|
|
map_row_column_to_led( row, column, &index );
|
|
|
if ( index < BACKLIGHT_LED_COUNT )
|
|
|
{
|
|
|
- if ( ( g_config.alphas_mods[row] & (1<<column) ) == 0 )
|
|
|
+#if defined(RGB_BACKLIGHT_U80_A)
|
|
|
+ if ( row == 0 )
|
|
|
+ {
|
|
|
+ is_alpha = ( column < 16 ) && (( 0b1110000111100001 & (1<<column) ) == 0);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ is_alpha = ( column < 16 ) && (( g_config.alphas_mods[row-1] & (1<<column) ) == 0);
|
|
|
+ }
|
|
|
+#else
|
|
|
+ is_alpha = ( g_config.alphas_mods[row] & (1<<column) ) == 0;
|
|
|
+#endif
|
|
|
+ if ( is_alpha )
|
|
|
{
|
|
|
backlight_set_color( index, rgb1.r, rgb1.g, rgb1.b );
|
|
|
}
|
|
@@ -1889,6 +2105,15 @@ void backlight_init_drivers(void)
|
|
|
IS31FL3731_init( ISSI_ADDR_1 );
|
|
|
IS31FL3731_init( ISSI_ADDR_2 );
|
|
|
|
|
|
+#if defined(RGB_BACKLIGHT_U80_A)
|
|
|
+ IS31FL3731_init( ISSI_ADDR_3 );
|
|
|
+#endif
|
|
|
+
|
|
|
+ // Experimental feature, not in configuration yet
|
|
|
+#if defined(RGB_BACKLIGHT_ZEAL60)
|
|
|
+ bool disable_spacebar_stab_leds = false;
|
|
|
+#endif
|
|
|
+
|
|
|
for ( int index = 0; index < DRIVER_LED_TOTAL; index++ )
|
|
|
{
|
|
|
// OR the possible "disabled" cases together, then NOT the result to get the enabled state
|
|
@@ -1928,13 +2153,35 @@ void backlight_init_drivers(void)
|
|
|
( index == 18+8 ) || // LB8
|
|
|
( index == 18+15 ) || // LB15
|
|
|
( index == 18+16 ) || // LB16
|
|
|
- ( index == 18+17 ) ); // LB17
|
|
|
+ ( index == 18+17 ) || // LB17
|
|
|
+ ( index == 36+6 && disable_spacebar_stab_leds ) || // LC6
|
|
|
+ ( index == 54+13 && disable_spacebar_stab_leds ) || // LD13
|
|
|
+ ( index == 54+14 && disable_spacebar_stab_leds && g_config.use_7u_spacebar ) ); // LD14
|
|
|
+#elif defined(RGB_BACKLIGHT_U80_A)
|
|
|
+// LB5, LB6, LB7, LB8, LB15, LB16, LB17, LC15, LD8, LD13, LE0-LE8, LF13
|
|
|
+ bool enabled = !(
|
|
|
+ ( index == 18+5 ) || // LB5
|
|
|
+ ( index == 18+6 ) || // LB6
|
|
|
+ ( index == 18+7 ) || // LB7
|
|
|
+ ( index == 18+8 ) || // LB8
|
|
|
+ ( index == 18+15 ) || // LB15
|
|
|
+ ( index == 18+16 ) || // LB16
|
|
|
+ ( index == 18+16 ) || // LB17
|
|
|
+ ( index == 36+15 ) || // LC15
|
|
|
+ ( index == 54+8 ) || // LD8
|
|
|
+ ( index == 54+13 ) || // LD13
|
|
|
+ ( index >= 72+0 && index <= 72+8 ) || // LE0-LE8
|
|
|
+ ( index == 90+13 ) ); // LF13
|
|
|
#endif
|
|
|
// This only caches it for later
|
|
|
IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
|
|
|
}
|
|
|
// This actually updates the LED drivers
|
|
|
- IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 );
|
|
|
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 );
|
|
|
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 );
|
|
|
+#if defined(RGB_BACKLIGHT_U80_A)
|
|
|
+ IS31FL3731_update_led_control_registers( ISSI_ADDR_3, 2 );
|
|
|
+#endif
|
|
|
#endif // !defined(RGB_BACKLIGHT_M6_B)
|
|
|
|
|
|
// TODO: put the 1 second startup delay here?
|
|
@@ -2193,4 +2440,3 @@ void backlight_debug_led( bool state )
|
|
|
}
|
|
|
#endif // defined(RGB_DEBUGGING_ONLY)
|
|
|
|
|
|
-#endif // BACKLIGHT_ENABLED
|