aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/wilba_tech
diff options
context:
space:
mode:
authoryiancar <yiangosyiangou@cytanet.com.cy>2020-06-16 22:02:01 +0100
committerGitHub <noreply@github.com>2020-06-16 14:02:01 -0700
commit0b7b74f56a68bdae82e74c61de22f9eae42488d7 (patch)
treeb4fc45bec829f9adf9e1f81d88e867d2a2aca957 /keyboards/wilba_tech
parent80b2b710da1795940ec519909594bd19872346ec (diff)
downloadfirmware-0b7b74f56a68bdae82e74c61de22f9eae42488d7.tar.gz
firmware-0b7b74f56a68bdae82e74c61de22f9eae42488d7.tar.bz2
firmware-0b7b74f56a68bdae82e74c61de22f9eae42488d7.zip
Nebula65 (#9368)
* Initial nebula65 commit * Use PWM driver * Polishing * Remove random rgblight settings * Spelling fix * Update keyboards/nebula65/keymaps/default/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/nebula65/keymaps/via/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/nebula65/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/nebula65/readme.md Co-authored-by: Ryan <fauxpark@gmail.com> * Clean includes in .h file * Update keyboards/nebula65/readme.md Co-authored-by: Drashna Jaelre <drashna@live.com> * Further cleanup Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/wilba_tech')
-rw-r--r--keyboards/wilba_tech/wt_rgb_backlight.c164
1 files changed, 101 insertions, 63 deletions
diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c
index 1a8bd8981..221d924c4 100644
--- a/keyboards/wilba_tech/wt_rgb_backlight.c
+++ b/keyboards/wilba_tech/wt_rgb_backlight.c
@@ -21,6 +21,7 @@
defined(RGB_BACKLIGHT_KOYU) || \
defined(RGB_BACKLIGHT_HS60) || \
defined(RGB_BACKLIGHT_NK65) || \
+ defined(RGB_BACKLIGHT_NEBULA65) || \
defined(RGB_BACKLIGHT_U80_A) || \
defined(RGB_BACKLIGHT_DAWN60) || \
defined(RGB_BACKLIGHT_WT60_B) || \
@@ -43,7 +44,7 @@
#include "wt_rgb_backlight_api.h"
#include "wt_rgb_backlight_keycodes.h"
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_NEBULA65)
#include <avr/interrupt.h>
#include "drivers/avr/i2c_master.h"
#else
@@ -74,7 +75,7 @@ LED_TYPE g_ws2812_leds[WS2812_LED_TOTAL];
#elif defined(RGB_BACKLIGHT_HS60)
#include "drivers/issi/is31fl3733.h"
#define BACKLIGHT_LED_COUNT 64
-#elif defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
#include "drivers/issi/is31fl3733.h"
#define BACKLIGHT_LED_COUNT 69
#else
@@ -211,7 +212,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{0, K_16, J_16, L_16}, //LA64
};
-#elif defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
// 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)
@@ -498,7 +499,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
* | | G location
* | | | B location
* | | | | */
- {0, C1_1, C3_2, C4_2}, //A1
+ {0, C1_1, C3_2, C4_2}, //A1
{0, C1_2, C2_2, C4_3}, //A2
{0, C1_3, C2_3, C3_3}, //A3
{0, C1_4, C2_4, C3_4}, //A4
@@ -564,7 +565,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{1, C9_13, C8_13, C7_13}, //D13
{1, C9_14, C8_14, C7_14}, //D14
{1, C9_15, C8_15, C6_14}, //D15
- {1, C9_16, C7_15, C6_15} //D16
+ {1, C9_16, C7_15, C6_15} //D16
};
#elif !defined(RGB_BACKLIGHT_M6_B)
// This is a 7-bit address, that gets left-shifted and bit 0
@@ -808,7 +809,7 @@ 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
{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},
+ {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},
@@ -819,7 +820,7 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
{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},
+ {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},
@@ -883,7 +884,7 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
// LA1..LA50
{0,0}, {4,16}, {6,32}, {2,48}, {16,0}, {24,16}, {28,32}, {36,48}, {32,0}, {40,16}, {44,32}, {52,48}, {48,0},
- {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, {96,0}, {104,16},
+ {56,16}, {60,32}, {68,48}, {64,0}, {72,16}, {76,32}, {84,48}, {80,0}, {88,16}, {92,32}, {100,48}, {96,0}, {104,16},
{108,32}, {116,48}, {112,0}, {120,16}, {124,32}, {132,48}, {128,0}, {136,16}, {140,32}, {148,48}, {144,0}, {152,16},
{156,32}, {164,48}, {160,0}, {168,16}, {172,32}, {180,48}, {176,0}, {184, 16}, {188,32}, {20,48}, {192,0}, {200,16},
{255,255},// LA51 does not exit, dummy
@@ -896,7 +897,7 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
// LA1..LA50
{96,255}, {109,255}, {128,242}, {147,255}, {93,255}, {105,238}, {128,192}, {154,216}, {89,255}, {101,208}, {128,155}, {159,188}, {85,255},
{96,181}, {128,119}, {165,163}, {81,255}, {89,157}, {128,82}, {173,143}, {75,255}, {81,139}, {128,46}, {183,131}, {70,255}, {70,129},
- {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, {53,255}, {39,157}, {255,101},
+ {129,9}, {195,128}, {64,255}, {58,129}, {255,27}, {206,136}, {58,255}, {47,139}, {255,64}, {215,152}, {53,255}, {39,157}, {255,101},
{222,175}, {47,255}, {32,181}, {255,137}, {228,201}, {43,255}, {27,208}, {255, 174}, {150,246}, {39,255}, {23,238},
{255,255},// LA51 does not exit, dummy
// LA52..LA60
@@ -927,6 +928,29 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
//LA62..LB5
{221,255}, {225,255}, {229,255}, {22,255}, {12,255}, {244,255}, {234,255}, {255,255}
};
+#elif defined(RGB_BACKLIGHT_NEBULA65)
+const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA1..LA60
+ {0,0}, {4,16}, {6,31}, {10,47}, {16,0}, {24,16}, {27,31}, {35,47}, {31,0}, {39,16}, {43,31}, {51,47},
+ {47,0}, {55,16}, {59,31}, {67,47}, {63,0}, {71,16}, {75,31}, {82,47}, {79,0}, {86,16}, {90,31}, {98,47},
+ {94,0}, {102,16}, {106,31}, {114,47}, {110,0}, {118,16}, {122,31}, {130,47}, {126,0}, {133,16}, {137,31},
+ {145,47}, {141,0}, {149,16}, {153,31}, {161,47}, {157,0}, {165,16}, {169,31}, {177,47}, {173,0}, {181, 16}, {184,31},
+ {159,63}, {188,0}, {196,16}, {206,47}, {220,47}, {212,0}, {216,16}, {210,31}, {220,63}, {2,63}, {22,63}, {41,63}, {100,63},
+ {255,255},// LA61 does not exit, dummy
+ //LA62..LB5
+ {179,63}, {198,63}, {224,63}, {239,0}, {239,16}, {255,16}, {255,63}, {255,0}
+};
+const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
+ // LA1..LA60
+ {96,255}, {109,255}, {128,244}, {148,255}, {93,255}, {106,245}, {128,201}, {153,225}, {80,255}, {103,219}, {128,169}, {156,200},
+ {87,255}, {99,194}, {128,138}, {161,177}, {83,255}, {94,171}, {128,106}, {167,157}, {79,255}, {87,152}, {128,75}, {174,141}, {74,255},
+ {80,138}, {128,43}, {183,131}, {70,255}, {70,129}, {129,12}, {193,128}, {65,255}, {60,128}, {255,20}, {203,133}, {60,255},
+ {51,135}, {255,51}, {212,145}, {55,255}, {42,148}, {255,83}, {219,162}, {50,255}, {36,166}, {255,114},
+ {202,255}, {46,255}, {30,188}, {228,203}, {231,225}, {40,255}, {25,219}, {255,165}, {217,255}, {160,255}, {164,255}, {168,255}, {183,255},
+ {255,255},// LA61 does not exit, dummy
+ //LA62..LB5
+ {207,255}, {213,255}, {218,255}, {35,255}, {21,255}, {19,255}, {224,255}, {32,255}
+};
#elif defined(RGB_BACKLIGHT_M6_B)
// M6-B is really simple:
// 0 3 5
@@ -940,45 +964,45 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
#elif defined(RGB_BACKLIGHT_DAWN60)
const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = {
// LA1..LA16
- {104, 16}, {88 , 16}, {72 , 16}, {56 , 16}, {40 , 16}, {24 , 16}, {4 , 16}, {6 , 32},
- {112, 0}, {96 , 0}, {80 , 0}, {64 , 0}, {48 , 0}, {32 , 0}, {16 , 0}, {0 , 0},
+ {104, 16}, {88 , 16}, {72 , 16}, {56 , 16}, {40 , 16}, {24 , 16}, {4 , 16}, {6 , 32},
+ {112, 0}, {96 , 0}, {80 , 0}, {64 , 0}, {48 , 0}, {32 , 0}, {16 , 0}, {0 , 0},
// LB1..LB16
- {128, 0}, {144, 0}, {160, 0}, {176, 0}, {192, 0}, {208, 0}, {224, 0}, {214, 32},
+ {128, 0}, {144, 0}, {160, 0}, {176, 0}, {192, 0}, {208, 0}, {224, 0}, {214, 32},
{120, 16}, {136, 16}, {152, 16}, {168, 16}, {184, 16}, {200, 16}, {220, 16}, {224, 48},
// LC1..LC16
- {100, 48}, {84 , 48}, {68 , 48}, {52 , 48}, {36 , 48}, {102, 64}, {42 , 64}, {22 , 64},
- {108, 32}, {92 , 32}, {76 , 32}, {60 , 32}, {44 , 32}, {28 , 32}, {10 , 48}, {2 , 64},
+ {100, 48}, {84 , 48}, {68 , 48}, {52 , 48}, {36 , 48}, {102, 64}, {42 , 64}, {22 , 64},
+ {108, 32}, {92 , 32}, {76 , 32}, {60 , 32}, {44 , 32}, {28 , 32}, {10 , 48}, {2 , 64},
// LD1..LD16
- {124, 32}, {140, 32}, {156, 32}, {172, 32}, {188, 32}, {180, 48}, {202, 48}, {224, 64},
+ {124, 32}, {140, 32}, {156, 32}, {172, 32}, {188, 32}, {180, 48}, {202, 48}, {224, 64},
{116, 48}, {132, 48}, {148, 48}, {164, 48}, {160, 64}, {176, 64}, {192, 64}, {208, 64},
- //RGB UNDERGLOW
- {27 , 3}, {64 , 3}, {100, 3}, {137, 3}, {173, 3}, {209, 3}, {242, 4}, {255, 8}, {255,32}, {255,64},
- {241,64}, {212,64}, {173,64}, {137,64}, {100,64}, {63 ,64}, {28 ,64}, {0 ,64}, {0 ,32}, {0 , 8}, //20
+ //RGB UNDERGLOW
+ {27 , 3}, {64 , 3}, {100, 3}, {137, 3}, {173, 3}, {209, 3}, {242, 4}, {255, 8}, {255,32}, {255,64},
+ {241,64}, {212,64}, {173,64}, {137,64}, {100,64}, {63 ,64}, {28 ,64}, {0 ,64}, {0 ,32}, {0 , 8}, //20
};
const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = {
- //LA1..LA16
- {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247},
- {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255},
- //LB1..LB16
- {58,255}, {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,233},
- {58,129}, {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {237,255},
- //LC1..LC16
- {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {188,255}, {170,255}, {165,255},
- {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {147,255}, {161,255},
- //LD1..LD16
- {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {228,201}, {235,255}, {224,255},
- {195,128}, {206,136}, {215,152}, {222,175}, {208,255}, {213,255}, {217, 255}, {222,225},
-
- //UNDERGLOW, {A,D}
- //1 - 10
- {91,255}, {84,255}, {74,255}, {60,255}, {48,255}, {39,255}, {32,255}, {27,255}, {0,255}, {236,255},
- //11 - 20
- {234,255}, {222,255}, {213,255}, {197,255}, {180,255}, {167,255}, {152,255}, {147,255}, {128,255}, {101,255}
+ //LA1..LA16
+ {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247},
+ {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255},
+ //LB1..LB16
+ {58,255}, {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,233},
+ {58,129}, {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {237,255},
+ //LC1..LC16
+ {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {188,255}, {170,255}, {165,255},
+ {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {147,255}, {161,255},
+ //LD1..LD16
+ {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {228,201}, {235,255}, {224,255},
+ {195,128}, {206,136}, {215,152}, {222,175}, {208,255}, {213,255}, {217, 255}, {222,225},
+
+ //UNDERGLOW, {A,D}
+ //1 - 10
+ {91,255}, {84,255}, {74,255}, {60,255}, {48,255}, {39,255}, {32,255}, {27,255}, {0,255}, {236,255},
+ //11 - 20
+ {234,255}, {222,255}, {213,255}, {197,255}, {180,255}, {167,255}, {152,255}, {147,255}, {128,255}, {101,255}
};
#endif
@@ -994,7 +1018,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)
+#if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
return;
#endif
@@ -1181,7 +1205,7 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
{ 4-1, 48-1, 8-1, 12-1, 16-1, 20-1, 24-1, 28-1, 32-1, 36-1, 40-1, 44-1, 255, 52-1 },
{ 57-1, 58-1, 59-1, 255, 255, 255, 60-1, 255, 255, 255, 62-1, 63-1, 64-1, 56-1 }
};
-#elif defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
//
// LA1, LA5, LA9, LA13, LA17, LA21, LA25, LA29, LA33, LA37, LA41, LA45, LA49, LA53, LB1,
// LA2, LA6, LA10, LA14, LA18, LA22, LA26, LA30, LA34, LA38, LA42, LA46, LA50, ---, LB2,
@@ -1207,15 +1231,15 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
// A16, A15, A14, A13, A12, A11, A10, A9, B1, B2, B3, B4, B5, B6,
// A7, A6, A5, A4, A3, A2, A1, B9, B10, B11, B12, B13, B14, B15,
// A8, C14, C13, C12, C11, C10, C9, D1, D2, D3, D4, D5, B8, B7,
-// C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, ---, D6, D7, B16,
-// C16, C8, C7, ---, ---, C6, ---, ---, ---, D13, D14, D15, D16, D8,
+// C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, ---, D6, D7, B16,
+// C16, C8, C7, ---, ---, C6, ---, ---, ---, D13, D14, D15, D16, D8,
const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
- { -1+16, -1+15, -1+14, -1+13, -1+12, -1+11, -1+10, -1+9 , 15+1 , 15+2 , 15+3 , 15+4 , 15+5 , 15+6 },
- { -1+7 , -1+6 , -1+5 , -1+4 , -1+3 , -1+2 , -1 +1, 15+9 , 15+10, 15+11, 15+12, 15+13, 15+14, 15+15},
- { -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 }
-};
+ { -1+16, -1+15, -1+14, -1+13, -1+12, -1+11, -1+10, -1+9 , 15+1 , 15+2 , 15+3 , 15+4 , 15+5 , 15+6 },
+ { -1+7 , -1+6 , -1+5 , -1+4 , -1+3 , -1+2 , -1 +1, 15+9 , 15+10, 15+11, 15+12, 15+13, 15+14, 15+15},
+ { -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 }
+};
#endif
void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led )
@@ -1234,7 +1258,7 @@ void backlight_update_pwm_buffers(void)
#elif defined(RGB_BACKLIGHT_HS60)
IS31FL3733_update_pwm_buffers( ISSI_ADDR_1, 0 );
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
-#elif defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
IS31FL3733_update_pwm_buffers( ISSI_ADDR_1, 0 );
IS31FL3733_update_pwm_buffers( ISSI_ADDR_2, 1 );
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
@@ -1269,7 +1293,7 @@ void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
{
#if defined(RGB_BACKLIGHT_M6_B)
IS31FL3218_set_color( index, red, green, blue );
-#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
IS31FL3733_set_color( index, red, green, blue );
#elif defined(RGB_BACKLIGHT_DAWN60)
if( index < DRIVER_LED_TOTAL ) {
@@ -1278,7 +1302,7 @@ void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
g_ws2812_leds[index - DRIVER_LED_TOTAL].r = red;
g_ws2812_leds[index - DRIVER_LED_TOTAL].g = green;
g_ws2812_leds[index - DRIVER_LED_TOTAL].b = blue;
- ws2812_setleds(g_ws2812_leds, WS2812_LED_TOTAL);
+ ws2812_setleds(g_ws2812_leds, WS2812_LED_TOTAL);
}
#else
IS31FL3731_set_color( index, red, green, blue );
@@ -1289,7 +1313,7 @@ void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
{
#if defined(RGB_BACKLIGHT_M6_B)
IS31FL3218_set_color_all( red, green, blue );
-#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65)
+#elif defined(RGB_BACKLIGHT_HS60) || defined(RGB_BACKLIGHT_NK65) || defined(RGB_BACKLIGHT_NEBULA65)
// This is done to avoid indicator LEDs being set
for (int i = 0; i < BACKLIGHT_LED_COUNT; i++) {
IS31FL3733_set_color(i, red, green, blue);
@@ -1301,7 +1325,7 @@ void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
g_ws2812_leds[i].g = green;
g_ws2812_leds[i].b = blue;
}
- ws2812_setleds(g_ws2812_leds, WS2812_LED_TOTAL);
+ ws2812_setleds(g_ws2812_leds, WS2812_LED_TOTAL);
#else
IS31FL3731_set_color_all( red, green, blue );
#endif
@@ -1316,7 +1340,7 @@ void backlight_set_key_hit(uint8_t row, uint8_t column)
g_any_key_hit = 0;
}
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_NEBULA65)
// This is (F_CPU/1024) / 20 Hz
// = 15625 Hz / 20 Hz
// = 781
@@ -1508,15 +1532,15 @@ void backlight_effect_alphas_mods(void)
}
}
}
-#if defined(RGB_BACKLIGHT_DAWN60)
- for (int i = 0; i < WS2812_LED_TOTAL; i++) {
- if ((RGB_UNDERGLOW_ALPHA_TOP_START <= i && i <= RGB_UNDERGLOW_ALPHA_TOP_END) ||
+#if defined(RGB_BACKLIGHT_DAWN60)
+ for (int i = 0; i < WS2812_LED_TOTAL; i++) {
+ if ((RGB_UNDERGLOW_ALPHA_TOP_START <= i && i <= RGB_UNDERGLOW_ALPHA_TOP_END) ||
(RGB_UNDERGLOW_ALPHA_BOT_START <= i && i <= RGB_UNDERGLOW_ALPHA_BOT_END)) {
backlight_set_color(i + DRIVER_LED_TOTAL, rgb1.r, rgb1.g, rgb1.b);
- } else {
+ } else {
backlight_set_color(i + DRIVER_LED_TOTAL, rgb2.r, rgb2.g, rgb2.b);
- }
- }
+ }
+ }
#endif
}
@@ -1611,7 +1635,7 @@ void backlight_effect_cycle_all(void)
for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ )
{
uint16_t offset2 = g_key_hit[i]<<2;
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60) && !defined(RGB_BACKLIGHT_NEBULA65)
// stabilizer LEDs use spacebar hits
if ( i == 36+6 || i == 54+13 || // LC6, LD13
( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
@@ -1636,7 +1660,7 @@ void backlight_effect_cycle_left_right(void)
for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ )
{
uint16_t offset2 = g_key_hit[i]<<2;
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60) && !defined(RGB_BACKLIGHT_NEBULA65)
// stabilizer LEDs use spacebar hits
if ( i == 36+6 || i == 54+13 || // LC6, LD13
( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
@@ -1663,7 +1687,7 @@ void backlight_effect_cycle_up_down(void)
for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ )
{
uint16_t offset2 = g_key_hit[i]<<2;
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_DAWN60) && !defined(RGB_BACKLIGHT_NEBULA65)
// stabilizer LEDs use spacebar hits
if ( i == 36+6 || i == 54+13 || // LC6, LD13
( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14
@@ -1837,7 +1861,7 @@ void backlight_effect_indicators(void)
}
}
-#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65)
+#if !defined(RGB_BACKLIGHT_HS60) && !defined(RGB_BACKLIGHT_NK65) && !defined(RGB_BACKLIGHT_NEBULA65)
ISR(TIMER3_COMPA_vect)
#else //STM32 interrupt
static void gpt_backlight_timer_task(GPTDriver *gptp)
@@ -2334,6 +2358,20 @@ void backlight_init_drivers(void)
// This actually updates the LED drivers
IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 );
+#elif defined(RGB_BACKLIGHT_NEBULA65)
+ IS31FL3733_init( ISSI_ADDR_1, 0 );
+ IS31FL3733_init( ISSI_ADDR_2, 0 );
+
+ for ( int index = 0; index < DRIVER_LED_TOTAL; index++ )
+ {
+ bool enabled = !( ( index == 61-1 ) || //LA61
+ ( index > 5+64-1 ) ); //LB6-LB64
+ // This only caches it for later
+ IS31FL3733_set_led_control_register( index, enabled, enabled, enabled );
+ }
+ // This actually updates the LED drivers
+ IS31FL3733_update_led_control_registers( ISSI_ADDR_1, 0 );
+ IS31FL3733_update_led_control_registers( ISSI_ADDR_2, 1 );
#else
IS31FL3731_init( ISSI_ADDR_1 );
IS31FL3731_init( ISSI_ADDR_2 );
@@ -2430,7 +2468,7 @@ void backlight_init_drivers(void)
// This actually updates the LED drivers
IS31FL3731_update_led_control_registers( ISSI_ADDR_1, 0 );
IS31FL3731_update_led_control_registers( ISSI_ADDR_2, 1 );
-#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)