diff options
author | XScorpion2 <rcalt2vt@gmail.com> | 2019-04-30 00:18:50 +0200 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-04-29 15:18:50 -0700 |
commit | a7113c8ed090d0ac647f30ee9b8ef41252e568ed (patch) | |
tree | 24d33db679b4d1357efef2784e69fea48e98d0ed | |
parent | 1d784f0f9575b70e35c9c8338b0ff80dc7316d7e (diff) |
Updated rgb_led struct field modifier to flags (#5619)
Updated effects to test led flags
Updated massdrop to use new flags field for led toggle
57 files changed, 1173 insertions, 1028 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 4ce9d15f0f..91ec77ace0 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -127,13 +127,13 @@ Configure the hardware via your `config.h`: From this point forward the configuration is the same for all the drivers. The struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example: ```C -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} * | {x=0..224, y=0..64} - * | | modifier + * | | flags * | | | */ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, - {{0|(1<<4)}, {20.36*1, 21.33*0}, 1}, + {{0|(1<<4)}, {20.36*1, 21.33*0}, 4}, .... } ``` @@ -147,7 +147,19 @@ y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout. -`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). +`flags` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type. + +## Flags + +|Define |Description | +|------------------------------------|-------------------------------------------| +|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.| +|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.| +|`#define LED_FLAG_NONE 0x00` |If thes LED has no flags. | +|`#define LED_FLAG_ALL 0xFF` |If thes LED has all flags. | +|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. | +|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. | +|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. | ## Keycodes diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c index 9baed223bc..45c1855491 100644 --- a/keyboards/boston_meetup/2019/2019.c +++ b/keyboards/boston_meetup/2019/2019.c @@ -21,17 +21,17 @@ #ifdef RGB_MATRIX_ENABLE #include "rgblight.h" -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} | {x=0..224, y=0..64} | | modifier | | | */ - {{1|(3<<4)}, {188, 16}, 0}, - {{3|(3<<4)}, {187, 48}, 0}, - {{4|(2<<4)}, {149, 64}, 0}, - {{4|(1<<4)}, {112, 64}, 0}, - {{3|(0<<4)}, {37, 48}, 0}, - {{1|(0<<4)}, {38, 16}, 0} + {{1|(3<<4)}, {188, 16}, 4}, + {{3|(3<<4)}, {187, 48}, 4}, + {{4|(2<<4)}, {149, 64}, 4}, + {{4|(1<<4)}, {112, 64}, 4}, + {{3|(0<<4)}, {37, 48}, 4}, + {{1|(0<<4)}, {38, 16}, 4} }; #endif diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c index 0104adf151..2345028d2c 100644 --- a/keyboards/crkbd/rev1/rev1.c +++ b/keyboards/crkbd/rev1/rev1.c @@ -56,70 +56,70 @@ void led_set_kb(uint8_t usb_led) { * | | | modifier * | | | */ #define RGB_MATRIX_LEFT_LEDS \ - { { 0xFF }, { 85, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 50, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 16, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 16, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 50, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 85, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 85, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 50, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 16, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 16, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 50, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 85, 52 }, 2 }, /* 6 */ \ { { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \ - { { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, /* 8 */ \ - { { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, /* 9 */ \ - { { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, /* 10 */ \ - { { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, /* 11 */ \ - { { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, /* 12 */ \ - { { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, /* 13 */ \ + { { 2 | ( 5 << 4 ) }, { 85, 39 }, 4 }, /* 8 */ \ + { { 1 | ( 5 << 4 ) }, { 85, 21 }, 4 }, /* 9 */ \ + { { 0 | ( 5 << 4 ) }, { 85, 4 }, 4 }, /* 10 */ \ + { { 0 | ( 4 << 4 ) }, { 68, 02 }, 4 }, /* 11 */ \ + { { 1 | ( 4 << 4 ) }, { 68, 19 }, 4 }, /* 12 */ \ + { { 2 | ( 4 << 4 ) }, { 68, 37 }, 4 }, /* 13 */ \ { { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \ { { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \ - { { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, /* 16 */ \ - { { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, /* 17 */ \ - { { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, /* 18 */ \ - { { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, /* 19 */ \ - { { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, /* 20 */ \ - { { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, /* 21 */ \ - { { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, /* 22 */ \ - { { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, /* 23 */ \ - { { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, /* 24 */ \ + { { 2 | ( 3 << 4 ) }, { 50, 35 }, 4 }, /* 16 */ \ + { { 1 | ( 3 << 4 ) }, { 50, 13 }, 4 }, /* 17 */ \ + { { 0 | ( 3 << 4 ) }, { 50, 0 }, 4 }, /* 18 */ \ + { { 0 | ( 2 << 4 ) }, { 33, 3 }, 4 }, /* 19 */ \ + { { 1 | ( 2 << 4 ) }, { 33, 20 }, 4 }, /* 20 */ \ + { { 2 | ( 2 << 4 ) }, { 33, 37 }, 4 }, /* 21 */ \ + { { 2 | ( 1 << 4 ) }, { 16, 42 }, 4 }, /* 22 */ \ + { { 1 | ( 1 << 4 ) }, { 16, 24 }, 4 }, /* 23 */ \ + { { 0 | ( 1 << 4 ) }, { 16, 7 }, 4 }, /* 24 */ \ { { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \ { { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \ { { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */ #define RGB_MATRIX_RIGHT_LEDS \ - { { 0xFF }, { 139, 16 }, 0 }, /* 1 */ \ - { { 0xFF }, { 174, 13 }, 0 }, /* 2 */ \ - { { 0xFF }, { 208, 20 }, 0 }, /* 3 */ \ - { { 0xFF }, { 208, 38 }, 0 }, /* 4 */ \ - { { 0xFF }, { 174, 48 }, 0 }, /* 5 */ \ - { { 0xFF }, { 139, 52 }, 0 }, /* 6 */ \ + { { 0xFF }, { 139, 16 }, 2 }, /* 1 */ \ + { { 0xFF }, { 174, 13 }, 2 }, /* 2 */ \ + { { 0xFF }, { 208, 20 }, 2 }, /* 3 */ \ + { { 0xFF }, { 208, 38 }, 2 }, /* 4 */ \ + { { 0xFF }, { 174, 48 }, 2 }, /* 5 */ \ + { { 0xFF }, { 139, 52 }, 2 }, /* 6 */ \ { { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \ - { { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, /* 8 */ \ - { { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, /* 9 */ \ - { { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, /* 10 */ \ - { { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, /* 11 */ \ - { { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, /* 12 */ \ - { { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, /* 13 */ \ + { { 6 | ( 5 << 4 ) }, { 139, 39 }, 4 }, /* 8 */ \ + { { 5 | ( 5 << 4 ) }, { 139, 21 }, 4 }, /* 9 */ \ + { { 4 | ( 5 << 4 ) }, { 139, 4 }, 4 }, /* 10 */ \ + { { 4 | ( 4 << 4 ) }, { 156, 02 }, 4 }, /* 11 */ \ + { { 5 | ( 4 << 4 ) }, { 156, 19 }, 4 }, /* 12 */ \ + { { 6 | ( 4 << 4 ) }, { 156, 37 }, 4 }, /* 13 */ \ { { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \ { { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \ - { { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, /* 16 */ \ - { { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, /* 17 */ \ - { { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, /* 18 */ \ - { { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, /* 19 */ \ - { { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, /* 20 */ \ - { { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, /* 21 */ \ - { { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, /* 22 */ \ - { { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, /* 23 */ \ - { { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, /* 24 */ \ + { { 6 | ( 3 << 4 ) }, { 174, 35 }, 4 }, /* 16 */ \ + { { 5 | ( 3 << 4 ) }, { 174, 13 }, 4 }, /* 17 */ \ + { { 4 | ( 3 << 4 ) }, { 174, 0 }, 4 }, /* 18 */ \ + { { 4 | ( 2 << 4 ) }, { 191, 3 }, 4 }, /* 19 */ \ + { { 5 | ( 2 << 4 ) }, { 191, 20 }, 4 }, /* 20 */ \ + { { 6 | ( 2 << 4 ) }, { 191, 37 }, 4 }, /* 21 */ \ + { { 6 | ( 1 << 4 ) }, { 208, 42 }, 4 }, /* 22 */ \ + { { 5 | ( 1 << 4 ) }, { 208, 24 }, 4 }, /* 23 */ \ + { { 4 | ( 1 << 4 ) }, { 208, 7 }, 4 }, /* 24 */ \ { { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \ { { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \ { { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */ #ifdef RGB_MATRIX_SPLIT_RIGHT -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_RIGHT_LEDS RGB_MATRIX_LEFT_LEDS }; #else -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { RGB_MATRIX_LEFT_LEDS RGB_MATRIX_RIGHT_LEDS }; diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c index 6f39e00c61..8aaf6ef4ad 100644 --- a/keyboards/doro67/rgb/rgb.c +++ b/keyboards/doro67/rgb/rgb.c @@ -52,73 +52,73 @@ void led_set_kb(uint8_t usb_led) { led_set_user(usb_led); } -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { - {{0|(0<<4)}, {15*0, 0}, 0}, // Esc - {{0|(1<<4)}, {15*1, 0}, 0}, // 1 - {{0|(2<<4)}, {15*2, 0}, 0}, // 2 - {{0|(3<<4)}, {15*3, 0}, 0}, // 3 - {{0|(4<<4)}, {15*4, 0}, 0}, // 4 - {{0|(5<<4)}, {15*5, 0}, 0}, // 5 - {{0|(6<<4)}, {15*6, 0}, 0}, // 6 - {{0|(7<<4)}, {15*7, 0}, 0}, // 7 - {{0|(8<<4)}, {15*8, 0}, 0}, // 8 - {{0|(9<<4)}, {15*9, 0}, 0}, // 9 - {{0|(10<<4)}, {15*10, 0}, 0}, // 0 - {{0|(11<<4)}, {15*11, 0}, 0}, // - - {{0|(12<<4)}, {15*12, 0}, 0}, // = +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0|(0<<4)}, {15*0, 0}, 4}, // Esc + {{0|(1<<4)}, {15*1, 0}, 4}, // 1 + {{0|(2<<4)}, {15*2, 0}, 4}, // 2 + {{0|(3<<4)}, {15*3, 0}, 4}, // 3 + {{0|(4<<4)}, {15*4, 0}, 4}, // 4 + {{0|(5<<4)}, {15*5, 0}, 4}, // 5 + {{0|(6<<4)}, {15*6, 0}, 4}, // 6 + {{0|(7<<4)}, {15*7, 0}, 4}, // 7 + {{0|(8<<4)}, {15*8, 0}, 4}, // 8 + {{0|(9<<4)}, {15*9, 0}, 4}, // 9 + {{0|(10<<4)}, {15*10, 0}, 4}, // 0 + {{0|(11<<4)}, {15*11, 0}, 4}, // - + {{0|(12<<4)}, {15*12, 0}, 4}, // = {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace {{0|(14<<4)}, {15*15, 0}, 1}, // Ins {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab - {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q - {{1|(2<<4)}, {15*2.5, 16}, 0}, // W - {{1|(3<<4)}, {15*3.5, 16}, 0}, // E - {{1|(4<<4)}, {15*4.5, 16}, 0}, // R - {{1|(5<<4)}, {15*5.5, 16}, 0}, // T - {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y - {{1|(7<<4)}, {15*7.5, 16}, 0}, // U - {{1|(8<<4)}, {15*8.5, 16}, 0}, // I - {{1|(9<<4)}, {15*9.5, 16}, 0}, // O - {{1|(10<<4)}, {15*10.5, 16}, 0}, // P - {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ - {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] - {{1|(13<<4)}, {15*13.75, 16}, 1}, // + {{1|(1<<4)}, {15*1.5, 16}, 4}, // Q + {{1|(2<<4)}, {15*2.5, 16}, 4}, // W + {{1|(3<<4)}, {15*3.5, 16}, 4}, // E + {{1|(4<<4)}, {15*4.5, 16}, 4}, // R + {{1|(5<<4)}, {15*5.5, 16}, 4}, // T + {{1|(6<<4)}, {15*6.5, 16}, 4}, // Y + {{1|(7<<4)}, {15*7.5, 16}, 4}, // U + {{1|(8<<4)}, {15*8.5, 16}, 4}, // I + {{1|(9<<4)}, {15*9.5, 16}, 4}, // O + {{1|(10<<4)}, {15*10.5, 16}, 4}, // P + {{1|(11<<4)}, {15*11.5, 16}, 4}, // [ + {{1|(12<<4)}, {15*12.5, 16}, 4}, // ] + {{1|(13<<4)}, {15*13.75, 16}, 1}, // {{1|(14<<4)}, {15*15, 16}, 1}, // Del {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock - {{2|(1<<4)}, {15*1.75, 32}, 0}, // A - {{2|(2<<4)}, {15*2.75, 32}, 0}, // S - {{2|(3<<4)}, {15*3.75, 32}, 0}, // D - {{2|(4<<4)}, {15*4.75, 32}, 0}, // F - {{2|(5<<4)}, {15*5.75, 32}, 0}, // G - {{2|(6<<4)}, {15*6.75, 32}, 0}, // H - {{2|(7<<4)}, {15*7.75, 32}, 0}, // J - {{2|(8<<4)}, {15*8.75, 32}, 0}, // K - {{2|(9<<4)}, {15*9.75, 32}, 0}, // L - {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; - {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' + {{2|(1<<4)}, {15*1.75, 32}, 4}, // A + {{2|(2<<4)}, {15*2.75, 32}, 4}, // S + {{2|(3<<4)}, {15*3.75, 32}, 4}, // D + {{2|(4<<4)}, {15*4.75, 32}, 4}, // F + {{2|(5<<4)}, {15*5.75, 32}, 4}, // G + {{2|(6<<4)}, {15*6.75, 32}, 4}, // H + {{2|(7<<4)}, {15*7.75, 32}, 4}, // J + {{2|(8<<4)}, {15*8.75, 32}, 4}, // K + {{2|(9<<4)}, {15*9.75, 32}, 4}, // L + {{2|(10<<4)}, {15*10.75, 32}, 4}, // ; + {{2|(11<<4)}, {15*11.75, 32}, 4}, // ' {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift - {{3|(2<<4)}, {15*2, 48}, 0}, // Z - {{3|(3<<4)}, {15*3, 48}, 0}, // X - {{3|(4<<4)}, {15*4, 48}, 0}, // C - {{3|(5<<4)}, {15*5, 48}, 0}, // V - {{3|(6<<4)}, {15*6, 48}, 0}, // B - {{3|(7<<4)}, {15*7, 48}, 0}, // N - {{3|(8<<4)}, {15*8, 48}, 0}, // M - {{3|(9<<4)}, {15*9, 48}, 0}, // , - {{3|(10<<4)}, {15*10, 48}, 0}, // . - {{3|(11<<4)}, {15*11, 48}, 0}, // / + {{3|(2<<4)}, {15*2, 48}, 4}, // Z + {{3|(3<<4)}, {15*3, 48}, 4}, // X + {{3|(4<<4)}, {15*4, 48}, 4}, // C + {{3|(5<<4)}, {15*5, 48}, 4}, // V + {{3|(6<<4)}, {15*6, 48}, 4}, // B + {{3|(7<<4)}, {15*7, 48}, 4}, // N + {{3|(8<<4)}, {15*8, 48}, 4}, // M + {{3|(9<<4)}, {15*9, 48}, 4}, // , + {{3|(10<<4)}, {15*10, 48}, 4}, // . + {{3|(11<<4)}, {15*11, 48}, 4}, // / {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift {{3|(13<<4)}, {15*14, 48}, 1}, // Up {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn - + {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt - {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space + {{4|(3<<4)}, {15*6.75, 64}, 4}, // Space {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN {{4|(12<<4)}, {15*13, 64}, 1}, // Left diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c index b1a03760f8..34bfc4366f 100644 --- a/keyboards/dztech/dz40rgb/dz40rgb.c +++ b/keyboards/dztech/dz40rgb/dz40rgb.c @@ -71,7 +71,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -90,32 +90,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, @@ -205,7 +205,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(11<<4)}, {20.36*11, 0}, 1}, {{0|(10<<4)}, {20.36*10, 0}, 1}, @@ -224,32 +224,32 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { {{0|(13<<4)}, {20.36*0,21.33*0.5}, 1}, {{1|(11<<4)}, {20.36*11, 21.33}, 1}, - {{1|(10<<4)}, {20.36*10, 21.33}, 0}, - {{1|(9<<4)}, {20.36*9, 21.33}, 0}, - {{1|(8<<4)}, {20.36*8, 21.33}, 0}, - {{1|(7<<4)}, {20.36*7, 21.33}, 0}, - {{1|(6<<4)}, { 20.36*6, 21.33}, 0}, - {{1|(5<<4)}, { 20.36*5, 21.33}, 0}, - {{1|(4<<4)}, { 20.36*4, 21.33}, 0}, - {{1|(3<<4)}, { 20.36*3, 21.33}, 0}, - {{1|(2<<4)}, { 20.36*2, 21.33}, 0}, - {{1|(1<<4)}, { 20.36*1, 21.33}, 0}, + {{1|(10<<4)}, {20.36*10, 21.33}, 4}, + {{1|(9<<4)}, {20.36*9, 21.33}, 4}, + {{1|(8<<4)}, {20.36*8, 21.33}, 4}, + {{1|(7<<4)}, {20.36*7, 21.33}, 4}, + {{1|(6<<4)}, { 20.36*6, 21.33}, 4}, + {{1|(5<<4)}, { 20.36*5, 21.33}, 4}, + {{1|(4<<4)}, { 20.36*4, 21.33}, 4}, + {{1|(3<<4)}, { 20.36*3, 21.33}, 4}, + {{1|(2<<4)}, { 20.36*2, 21.33}, 4}, + {{1|(1<<4)}, { 20.36*1, 21.33}, 4}, {{1|(0<<4)}, { 20.36*0, 21.33}, 1}, {{1|(12<<4)}, {20.36*11, 21.33*1.5}, 1}, {{1|(13<<4)}, {20.36*0,21.33*1.5}, 1}, {{2|(11<<4)}, {20.36*11, 21.33*2}, 1}, - {{2|(10<<4)}, {20.36*10, 21.33*2}, 0}, - {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, - {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, - {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, - {{2|(6<<4)}, { 20.36*6, 21.33*2}, 0}, - {{2|(5<<4)}, { 20.36*5, 21.33*2}, 0}, - {{2|(4<<4)}, { 20.36*4, 21.33*2}, 0}, - {{2|(3<<4)}, { 20.36*3, 21.33*2}, 0}, - {{2|(2<<4)}, { 20.36*2, 21.33*2}, 0}, - {{2|(1<<4)}, { 20.36*1, 21.33*2}, 0}, + {{2|(10<<4)}, {20.36*10, 21.33*2}, 4}, + {{2|(9<<4)}, {20.36*9, 21.33*2}, 4}, + {{2|(8<<4)}, {20.36*8, 21.33*2}, 4}, + {{2|(7<<4)}, {20.36*7, 21.33*2}, 4}, + {{2|(6<<4)}, { 20.36*6, 21.33*2}, 4}, + {{2|(5<<4)}, { 20.36*5, 21.33*2}, 4}, + {{2|(4<<4)}, { 20.36*4, 21.33*2}, 4}, + {{2|(3<<4)}, { 20.36*3, 21.33*2}, 4}, + {{2|(2<<4)}, { 20.36*2, 21.33*2}, 4}, + {{2|(1<<4)}, { 20.36*1, 21.33*2}, 4}, {{2|(0<<4)}, { 20.36*0, 21.33*2}, 1}, {{2|(12<<4)}, {20.36*11, 21.33*2.5}, 1}, diff --git a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c index 6ea7421c92..59b917121c 100644 --- a/keyboards/dztech/dz40rgb/keymaps/default/keymap.c +++ b/keyboards/dztech/dz40rgb/keymaps/default/keymap.c @@ -35,10 +35,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool def rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - if (led.modifier) { - rgb_matrix_set_color( i, red, green, blue ); - } + if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) { + rgb_matrix_set_color( i, red, green, blue ); } } } diff --git a/keyboards/dztech/dz |