]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Updated rgb_led struct field modifier to flags (#5619)
authorXScorpion2 <rcalt2vt@gmail.com>
Mon, 29 Apr 2019 22:18:50 +0000 (00:18 +0200)
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>
Mon, 29 Apr 2019 22:18:50 +0000 (15:18 -0700)
Updated effects to test led flags
Updated massdrop to use new flags field for led toggle

57 files changed:
docs/feature_rgb_matrix.md
keyboards/boston_meetup/2019/2019.c
keyboards/crkbd/rev1/rev1.c
keyboards/doro67/rgb/rgb.c
keyboards/dztech/dz40rgb/dz40rgb.c
keyboards/dztech/dz40rgb/keymaps/default/keymap.c
keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c
keyboards/dztech/dz60rgb/dz60rgb.c
keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c
keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c
keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c
keyboards/dztech/dz60rgb/keymaps/iso/keymap.c
keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c
keyboards/ergodox_ez/ergodox_ez.c
keyboards/exclusive/e6_rgb/e6_rgb.c
keyboards/hadron/ver3/ver3.c
keyboards/hs60/v1/v1.c
keyboards/massdrop/alt/config.h
keyboards/massdrop/alt/config_led.c
keyboards/massdrop/alt/keymaps/abishalom/keymap.c
keyboards/massdrop/alt/keymaps/default/keymap.c
keyboards/massdrop/alt/keymaps/mac/keymap.c
keyboards/massdrop/ctrl/config.h
keyboards/massdrop/ctrl/config_led.c
keyboards/massdrop/ctrl/keymaps/default/keymap.c
keyboards/massdrop/ctrl/keymaps/mac/keymap.c
keyboards/model01/leds.c
keyboards/planck/ez/ez.c
keyboards/planck/keymaps/tom/keymap.c
keyboards/planck/light/light.c
keyboards/sol/rev1/rev1.c
layouts/community/ergodox/drashna/keymap.c
layouts/community/ortho_4x12/drashna/keymap.c
quantum/rgb_matrix.c
quantum/rgb_matrix.h
quantum/rgb_matrix_animations/alpha_mods_anim.h
quantum/rgb_matrix_animations/breathing_anim.h
quantum/rgb_matrix_animations/cycle_all_anim.h
quantum/rgb_matrix_animations/cycle_left_right_anim.h
quantum/rgb_matrix_animations/cycle_up_down_anim.h
quantum/rgb_matrix_animations/dual_beacon_anim.h
quantum/rgb_matrix_animations/gradient_up_down_anim.h
quantum/rgb_matrix_animations/jellybean_raindrops_anim.h
quantum/rgb_matrix_animations/rainbow_beacon_anim.h
quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h
quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h
quantum/rgb_matrix_animations/raindrops_anim.h
quantum/rgb_matrix_animations/solid_color_anim.h
quantum/rgb_matrix_animations/solid_reactive_anim.h
quantum/rgb_matrix_animations/solid_reactive_cross.h
quantum/rgb_matrix_animations/solid_reactive_nexus.h
quantum/rgb_matrix_animations/solid_reactive_simple_anim.h
quantum/rgb_matrix_animations/solid_reactive_wide.h
quantum/rgb_matrix_animations/solid_splash_anim.h
quantum/rgb_matrix_animations/splash_anim.h
quantum/rgb_matrix_types.h
tmk_core/protocol/arm_atsam/led_matrix.c

index 4ce9d15f0f619f4080e411a945564af138a90303..91ec77ace086dfad67baa46c3b6f779025b1add0 100644 (file)
@@ -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
 
index 9baed223bc849a2b0044e8159b95a081cc52a1be..45c1855491528ddc492404b405206c5cecf713a3 100644 (file)
 #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
 
index 0104adf15137742341325eb4a0fe7c26c46439b7..2345028d2c9cab5c32020eeb85f7eea6cc20500c 100644 (file)
@@ -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
     };
index 6f39e00c6155944bab77f7221a0933aaf770e730..8aaf6ef4ad386557d4aba77170c5a94c19c0da6b 100644 (file)
@@ -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
index b1a03760f85b6282d89c1691ef9688a80091e062..34bfc4366f38da24726c87afed6e882eba5a0b06 100644 (file)
@@ -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},
index 6ea7421c928bcb3c793ab15fcd60b71f955a97f1..59b917121c63cc4187c16eeb35b8cd6b2e73a8a8 100644 (file)
@@ -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 );
     }
   }
 }
index bbbe5a8f0c0f6b610c01191e2a71e4f382a05053..5613e3500034ccb11397f97fe34c05d8efaaca75 100644 (file)
@@ -58,10 +58,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 );
     }
   }
 }
index a6825e750fde31e1f5de1b1a8ff51c04a830b431..10b2ea7a83dbf141292f2448d5fe592f33b733f3 100644 (file)
@@ -64,7 +64,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, H_16,   G_16,   I_16},
     {0, K_16,   J_16,   L_16},
 };
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(13<<4)},   {16*13.5,  0}, 1},
     {{0|(12<<4)},   {16*12,  0}, 1},
     {{0|(11<<4)},   {16*11,  0}, 1},
@@ -80,49 +81,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(1<<4)},    {16*1,  0}, 1},
     {{0|(0<<4)},    {16*0,  0}, 1},
        {{2|(13<<4)},   {16*13.75, 24}, 1},
-    {{1|(12<<4)},   {16*12.5,  16}, 0},
-    {{1|(11<<4)},   {16*11.5,  16}, 0},
-    {{1|(10<<4)},   {16*10.5,  16}, 0},
-    {{1|(9<<4)},    { 16*9.5,  16}, 0},
-    {{1|(8<<4)},    { 16*8.5,  16}, 0},
-    {{1|(7<<4)},    { 16*7.5,  16}, 0},
-       {{1|(6<<4)},    { 16*6.5,  16}, 0},
-    {{1|(5<<4)},    { 16*5.5,  16}, 0},
-    {{1|(4<<4)},    { 16*4.5,  16}, 0},
-    {{1|(3<<4)},    { 16*3.5,  16}, 0},
-    {{1|(2<<4)},    { 16*2.5,  16}, 0},
-    {{1|(1<<4)},    { 16*1.5,  16}, 0},
+    {{1|(12<<4)},   {16*12.5,  16}, 4},
+    {{1|(11<<4)},   {16*11.5,  16}, 4},
+    {{1|(10<<4)},   {16*10.5,  16}, 4},
+    {{1|(9<<4)},    { 16*9.5,  16}, 4},
+    {{1|(8<<4)},    { 16*8.5,  16}, 4},
+    {{1|(7<<4)},    { 16*7.5,  16}, 4},
+       {{1|(6<<4)},    { 16*6.5,  16}, 4},
+    {{1|(5<<4)},    { 16*5.5,  16}, 4},
+    {{1|(4<<4)},    { 16*4.5,  16}, 4},
+    {{1|(3<<4)},    { 16*3.5,  16}, 4},
+    {{1|(2<<4)},    { 16*2.5,  16}, 4},
+    {{1|(1<<4)},    { 16*1.5,  16}, 4},
     {{1|(0<<4)},    { 16*0.25,  16}, 1},
        {{1|(13<<4)},   {16*12.75,  32}, 1},
-    {{2|(11<<4)},   {16*11.75,  32}, 0},
-    {{2|(10<<4)},   {16*10.75,  32}, 0},
-    {{2|(9<<4)},    {16*9.75,  32}, 0},
-    {{2|(8<<4)},    {16*8.75,  32}, 0},
-    {{2|(7<<4)},    {16*7.75,  32}, 0},
-       {{2|(6<<4)},    { 16*6.75,  32}, 0},
-    {{2|(5<<4)},    { 16*5.75,  32}, 0},
-    {{2|(4<<4)},    { 16*4.75,  32}, 0},
-    {{2|(3<<4)},    { 16*3.75,  32}, 0},
-    {{2|(2<<4)},    { 16*2.75,  32}, 0},
-    {{2|(1<<4)},    { 16*1.75,  32}, 0},
+    {{2|(11<<4)},   {16*11.75,  32}, 4},
+    {{2|(10<<4)},   {16*10.75,  32}, 4},
+    {{2|(9<<4)},    {16*9.75,  32}, 4},
+    {{2|(8<<4)},    {16*8.75,  32}, 4},
+    {{2|(7<<4)},    {16*7.75,  32}, 4},
+       {{2|(6<<4)},    { 16*6.75,  32}, 4},
+    {{2|(5<<4)},    { 16*5.75,  32}, 4},
+    {{2|(4<<4)},    { 16*4.75,  32}, 4},
+    {{2|(3<<4)},    { 16*3.75,  32}, 4},
+    {{2|(2<<4)},    { 16*2.75,  32}, 4},
+    {{2|(1<<4)},    { 16*1.75,  32}, 4},
     {{2|(0<<4)},    { 16*0.375,  32}, 1},
     {{3|(11<<4)},   {16*13.125,  48}, 1},
-    {{3|(10<<4)},   {16*11.25,  48}, 0},
-    {{3|(9<<4)},    {16*10.25,  48}, 0},
-    {{3|(8<<4)},    {16*9.25,  48}, 0},
-    {{3|(7<<4)},    {16*8.25,  48}, 0},
-       {{3|(6<<4)},    {16*7.25,  48}, 0},
-    {{3|(5<<4)},    {16*6.25,  48}, 0},
-    {{3|(4<<4)},    {16*5.25,  48}, 0},
-    {{3|(3<<4)},    {16*4.25,  48}, 0},
-    {{3|(2<<4)},    {16*3.25,  48}, 0},
-    {{3|(1<<4)},    {16*1.25,  48}, 0},
+    {{3|(10<<4)},   {16*11.25,  48}, 4},
+    {{3|(9<<4)},    {16*10.25,  48}, 4},
+    {{3|(8<<4)},    {16*9.25,  48}, 4},
+    {{3|(7<<4)},    {16*8.25,  48}, 4},
+       {{3|(6<<4)},    {16*7.25,  48}, 4},
+    {{3|(5<<4)},    {16*6.25,  48}, 4},
+    {{3|(4<<4)},    {16*5.25,  48}, 4},
+    {{3|(3<<4)},    {16*4.25,  48}, 4},
+    {{3|(2<<4)},    {16*3.25,  48}, 4},
+    {{3|(1<<4)},    {16*1.25,  48}, 4},
     {{3|(0<<4)},    {16*0.625,  48}, 1},
        {{4|(13<<4)},   {16*13.875,  64}, 1},
     {{4|(11<<4)},   {16*12.625,  64}, 1},
     {{4|(10<<4)},   {16*11.375,  64}, 1},
     {{4|(9<<4)},    {16*10.125,  64}, 1},
-    {{4|(5<<4)},    { 16*6.375,  64}, 0},
+    {{4|(5<<4)},    { 16*6.375,  64}, 4},
     {{4|(2<<4)},    { 16*2.625,  64}, 1},
     {{4|(1<<4)},    { 16*1.375,  64}, 1},
     {{4|(0<<4)},    { 16*0.125,  64}, 1},
@@ -192,7 +193,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, H_16,   G_16,   I_16},
     {0, K_16,   J_16,   L_16},
 };
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
        {{2|(12<<4)},   {16*14,  0}, 1},
     {{0|(13<<4)},   {16*13,  0}, 1},
     {{0|(12<<4)},   {16*12,  0}, 1},
@@ -209,49 +211,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(1<<4)},    {16*1,  0}, 1},
     {{0|(0<<4)},    {16*0,  0}, 1},
        {{1|(13<<4)},   {16*13.75, 16}, 1},
-    {{1|(12<<4)},   {16*12.5,  16}, 0},
-    {{1|(11<<4)},   {16*11.5,  16}, 0},
-    {{1|(10<<4)},   {16*10.5,  16}, 0},
-    {{1|(9<<4)},    { 16*9.5,  16}, 0},
-    {{1|(8<<4)},    { 16*8.5,  16}, 0},
-    {{1|(7<<4)},    { 16*7.5,  16}, 0},
-       {{1|(6<<4)},    { 16*6.5,  16}, 0},
-    {{1|(5<<4)},    { 16*5.5,  16}, 0},
-    {{1|(4<<4)},    { 16*4.5,  16}, 0},
-    {{1|(3<<4)},    { 16*3.5,  16}, 0},
-    {{1|(2<<4)},    { 16*2.5,  16}, 0},
-    {{1|(1<<4)},    { 16*1.5,  16}, 0},
+    {{1|(12<<4)},   {16*12.5,  16}, 4},
+    {{1|(11<<4)},   {16*11.5,  16}, 4},
+    {{1|(10<<4)},   {16*10.5,  16}, 4},
+    {{1|(9<<4)},    { 16*9.5,  16}, 4},
+    {{1|(8<<4)},    { 16*8.5,  16}, 4},
+    {{1|(7<<4)},    { 16*7.5,  16}, 4},
+       {{1|(6<<4)},    { 16*6.5,  16}, 4},
+    {{1|(5<<4)},    { 16*5.5,  16}, 4},
+    {{1|(4<<4)},    { 16*4.5,  16}, 4},
+    {{1|(3<<4)},    { 16*3.5,  16}, 4},
+    {{1|(2<<4)},    { 16*2.5,  16}, 4},
+    {{1|(1<<4)},    { 16*1.5,  16}, 4},
     {{1|(0<<4)},    { 16*0.25,  16}, 1},
        {{2|(13<<4)},   {16*12.75,  32}, 1},
-    {{2|(11<<4)},   {16*11.75,  32}, 0},
-    {{2|(10<<4)},   {16*10.75,  32}, 0},
-    {{2|(9<<4)},    {16*9.75,  32}, 0},
-    {{2|(8<<4)},    {16*8.75,  32}, 0},
-    {{2|(7<<4)},    {16*7.75,  32}, 0},
-       {{2|(6<<4)},    { 16*6.75,  32}, 0},
-    {{2|(5<<4)},    { 16*5.75,  32}, 0},
-    {{2|(4<<4)},    { 16*4.75,  32}, 0},
-    {{2|(3<<4)},    { 16*3.75,  32}, 0},
-    {{2|(2<<4)},    { 16*2.75,  32}, 0},
-    {{2|(1<<4)},    { 16*1.75,  32}, 0},
+    {{2|(11<<4)},   {16*11.75,  32}, 4},
+    {{2|(10<<4)},   {16*10.75,  32}, 4},
+    {{2|(9<<4)},    {16*9.75,  32}, 4},
+    {{2|(8<<4)},    {16*8.75,  32}, 4},
+    {{2|(7<<4)},    {16*7.75,  32}, 4},
+       {{2|(6<<4)},    { 16*6.75,  32}, 4},
+    {{2|(5<<4)},    { 16*5.75,  32}, 4},
+    {{2|(4<<4)},    { 16*4.75,  32}, 4},
+    {{2|(3<<4)},    { 16*3.75,  32}, 4},
+    {{2|(2<<4)},    { 16*2.75,  32}, 4},
+    {{2|(1<<4)},    { 16*1.75,  32}, 4},
     {{2|(0<<4)},    { 16*0.375,  32}, 1},
     {{3|(13<<4)},   {16*14,     48}, 1},
-    {{3|(11<<4)},   {16*12.625, 48}, 0},
-    {{3|(10<<4)},   {16*11.25,  48}, 0},
-    {{3|(9<<4)},    {16*10.25,  48}, 0},
-    {{3|(8<<4)},    {16*9.25,  48}, 0},
-    {{3|(7<<4)},    {16*8.25,  48}, 0},
-       {{3|(6<<4)},    {16*7.25,  48}, 0},
-    {{3|(5<<4)},    {16*6.25,  48}, 0},
-    {{3|(4<<4)},    {16*5.25,  48}, 0},
-    {{3|(3<<4)},    {16*4.25,  48}, 0},
-    {{3|(2<<4)},    {16*3.25,  48}, 0},
-    {{3|(1<<4)},    {16*1.25,  48}, 0},
+    {{3|(11<<4)},   {16*12.625, 48}, 4},
+    {{3|(10<<4)},   {16*11.25,  48}, 4},
+    {{3|(9<<4)},    {16*10.25,  48}, 4},
+    {{3|(8<<4)},    {16*9.25,  48}, 4},
+    {{3|(7<<4)},    {16*8.25,  48}, 4},
+       {{3|(6<<4)},    {16*7.25,  48}, 4},
+    {{3|(5<<4)},    {16*6.25,  48}, 4},
+    {{3|(4<<4)},    {16*5.25,  48}, 4},
+    {{3|(3<<4)},    {16*4.25,  48}, 4},
+    {{3|(2<<4)},    {16*3.25,  48}, 4},
+    {{3|(1<<4)},    {16*1.25,  48}, 4},
     {{3|(0<<4)},    {16*0.625,  48}, 1},
        {{4|(13<<4)},   {16*13.625,  64}, 1},
     {{4|(11<<4)},   {16*12.375,  64}, 1},
     {{4|(10<<4)},   {16*11.125,  64}, 1},
-    {{4|(5<<4)},    { 16*7,      64}, 0},
+    {{4|(5<<4)},    { 16*7,      64}, 4},
     {{4|(2<<4)},    { 16*2.875,  64}, 1},
     {{4|(1<<4)},    { 16*1.625,  64}, 1},
     {{4|(0<<4)},    { 16*0.375,  64}, 1},
@@ -321,7 +323,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, H_16,   G_16,   I_16},
     {0, K_16,   J_16,   L_16},
 };
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
        {{2|(12<<4)},   {16*14,  0}, 1},
     {{0|(13<<4)},   {16*13,  0}, 1},
     {{0|(12<<4)},   {16*12,  0}, 1},
@@ -338,49 +341,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(1<<4)},    {16*1,  0}, 1},
     {{0|(0<<4)},    {16*0,  0}, 1},
        {{2|(13<<4)},   {16*13.75, 24}, 1},
-    {{1|(12<<4)},   {16*12.5,  16}, 0},
-    {{1|(11<<4)},   {16*11.5,  16}, 0},
-    {{1|(10<<4)},   {16*10.5,  16}, 0},
-    {{1|(9<<4)},    { 16*9.5,  16}, 0},
-    {{1|(8<<4)},    { 16*8.5,  16}, 0},
-    {{1|(7<<4)},    { 16*7.5,  16}, 0},
-       {{1|(6<<4)},    { 16*6.5,  16}, 0},
-    {{1|(5<<4)},    { 16*5.5,  16}, 0},
-    {{1|(4<<4)},    { 16*4.5,  16}, 0},
-    {{1|(3<<4)},    { 16*3.5,  16}, 0},
-    {{1|(2<<4)},    { 16*2.5,  16}, 0},
-    {{1|(1<<4)},    { 16*1.5,  16}, 0},
+    {{1|(12<<4)},   {16*12.5,  16}, 4},
+    {{1|(11<<4)},   {16*11.5,  16}, 4},
+    {{1|(10<<4)},   {16*10.5,  16}, 4},
+    {{1|(9<<4)},    { 16*9.5,  16}, 4},
+    {{1|(8<<4)},    { 16*8.5,  16}, 4},
+    {{1|(7<<4)},    { 16*7.5,  16}, 4},
+       {{1|(6<<4)},    { 16*6.5,  16}, 4},
+    {{1|(5<<4)},    { 16*5.5,  16}, 4},
+    {{1|(4<<4)},    { 16*4.5,  16}, 4},
+    {{1|(3<<4)},    { 16*3.5,  16}, 4},
+    {{1|(2<<4)},    { 16*2.5,  16}, 4},
+    {{1|(1<<4)},    { 16*1.5,  16}, 4},
     {{1|(0<<4)},    { 16*0.25,  16}, 1},
        {{1|(13<<4)},   {16*12.75,  32}, 1},
-    {{2|(11<<4)},   {16*11.75,  32}, 0},
-    {{2|(10<<4)},   {16*10.75,  32}, 0},
-    {{2|(9<<4)},    {16*9.75,  32}, 0},
-    {{2|(8<<4)},    {16*8.75,  32}, 0},
-    {{2|(7<<4)},    {16*7.75,  32}, 0},
-       {{2|(6<<4)},    { 16*6.75,  32}, 0},
-    {{2|(5<<4)},    { 16*5.75,  32}, 0},
-    {{2|(4<<4)},    { 16*4.75,  32}, 0},
-    {{2|(3<<4)},    { 16*3.75,  32}, 0},
-    {{2|(2<<4)},    { 16*2.75,  32}, 0},
-    {{2|(1<<4)},    { 16*1.75,  32}, 0},
+    {{2|(11<<4)},   {16*11.75,  32}, 4},
+    {{2|(10<<4)},   {16*10.75,  32}, 4},
+    {{2|(9<<4)},    {16*9.75,  32}, 4},
+    {{2|(8<<4)},    {16*8.75,  32}, 4},
+    {{2|(7<<4)},    {16*7.75,  32}, 4},
+       {{2|(6<<4)},    { 16*6.75,  32}, 4},
+    {{2|(5<<4)},    { 16*5.75,  32}, 4},
+    {{2|(4<<4)},    { 16*4.75,  32}, 4},
+    {{2|(3<<4)},    { 16*3.75,  32}, 4},
+    {{2|(2<<4)},    { 16*2.75,  32}, 4},
+    {{2|(1<<4)},    { 16*1.75,  32}, 4},
     {{2|(0<<4)},    { 16*0.375,  32}, 1},
     {{3|(13<<4)},   {16*14,     48}, 1},
-    {{3|(11<<4)},   {16*12.625, 48}, 0},
-    {{3|(10<<4)},   {16*11.25,  48}, 0},
-    {{3|(9<<4)},    {16*10.25,  48}, 0},
-    {{3|(8<<4)},    {16*9.25,  48}, 0},
-    {{3|(7<<4)},    {16*8.25,  48}, 0},
-       {{3|(6<<4)},    {16*7.25,  48}, 0},
-    {{3|(5<<4)},    {16*6.25,  48}, 0},
-    {{3|(4<<4)},    {16*5.25,  48}, 0},
-    {{3|(3<<4)},    {16*4.25,  48}, 0},
-    {{3|(2<<4)},    {16*3.25,  48}, 0},
-    {{3|(1<<4)},    {16*1.25,  48}, 0},
+    {{3|(11<<4)},   {16*12.625, 48}, 4},
+    {{3|(10<<4)},   {16*11.25,  48}, 4},
+    {{3|(9<<4)},    {16*10.25,  48}, 4},
+    {{3|(8<<4)},    {16*9.25,  48}, 4},
+    {{3|(7<<4)},    {16*8.25,  48}, 4},
+       {{3|(6<<4)},    {16*7.25,  48}, 4},
+    {{3|(5<<4)},    {16*6.25,  48}, 4},
+    {{3|(4<<4)},    {16*5.25,  48}, 4},
+    {{3|(3<<4)},    {16*4.25,  48}, 4},
+    {{3|(2<<4)},    {16*3.25,  48}, 4},
+    {{3|(1<<4)},    {16*1.25,  48}, 4},
     {{3|(0<<4)},    {16*0.625,  48}, 1},
        {{4|(13<<4)},   {16*13.625,  64}, 1},
     {{4|(11<<4)},   {16*12.375,  64}, 1},
     {{4|(10<<4)},   {16*11.125,  64}, 1},
-    {{4|(5<<4)},    { 16*7,      64}, 0},
+    {{4|(5<<4)},    { 16*7,      64}, 4},
     {{4|(2<<4)},    { 16*2.875,  64}, 1},
     {{4|(1<<4)},    { 16*1.625,  64}, 1},
     {{4|(0<<4)},    { 16*0.375,  64}, 1},
@@ -449,7 +452,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, H_16,   G_16,   I_16},
     {0, K_16,   J_16,   L_16},
 };
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(13<<4)},   {16*13.5,  0}, 1},
     {{0|(12<<4)},   {16*12,  0}, 1},
     {{0|(11<<4)},   {16*11,  0}, 1},
@@ -465,49 +469,49 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(1<<4)},    {16*1,  0}, 1},
     {{0|(0<<4)},    {16*0,  0}, 1},
        {{1|(13<<4)},   {16*13.75, 16}, 1},
-    {{1|(12<<4)},   {16*12.5,  16}, 0},
-    {{1|(11<<4)},   {16*11.5,  16}, 0},
-    {{1|(10<<4)},   {16*10.5,  16}, 0},
-    {{1|(9<<4)},    { 16*9.5,  16}, 0},
-    {{1|(8<<4)},    { 16*8.5,  16}, 0},
-    {{1|(7<<4)},    { 16*7.5,  16}, 0},
-       {{1|(6<<4)},    { 16*6.5,  16}, 0},
-    {{1|(5<<4)},    { 16*5.5,  16}, 0},
-    {{1|(4<<4)},    { 16*4.5,  16}, 0},
-    {{1|(3<<4)},    { 16*3.5,  16}, 0},
-    {{1|(2<<4)},    { 16*2.5,  16}, 0},
-    {{1|(1<<4)},    { 16*1.5,  16}, 0},
+    {{1|(12<<4)},   {16*12.5,  16}, 4},
+    {{1|(11<<4)},   {16*11.5,  16}, 4},
+    {{1|(10<<4)},   {16*10.5,  16}, 4},
+    {{1|(9<<4)},    { 16*9.5,  16}, 4},
+    {{1|(8<<4)},    { 16*8.5,  16}, 4},
+    {{1|(7<<4)},    { 16*7.5,  16}, 4},
+       {{1|(6<<4)},    { 16*6.5,  16}, 4},
+    {{1|(5<<4)},    { 16*5.5,  16}, 4},
+    {{1|(4<<4)},    { 16*4.5,  16}, 4},
+    {{1|(3<<4)},    { 16*3.5,  16}, 4},
+    {{1|(2<<4)},    { 16*2.5,  16}, 4},
+    {{1|(1<<4)},    { 16*1.5,  16}, 4},
     {{1|(0<<4)},    { 16*0.25,  16}, 1},
        {{2|(13<<4)},   {16*13.375,  24}, 1},
-    {{2|(11<<4)},   {16*11.75,  32}, 0},
-    {{2|(10<<4)},   {16*10.75,  32}, 0},
-    {{2|(9<<4)},    {16*9.75,  32}, 0},
-    {{2|(8<<4)},    {16*8.75,  32}, 0},
-    {{2|(7<<4)},    {16*7.75,  32}, 0},
-       {{2|(6<<4)},    { 16*6.75,  32}, 0},
-    {{2|(5<<4)},    { 16*5.75,  32}, 0},
-    {{2|(4<<4)},    { 16*4.75,  32}, 0},
-    {{2|(3<<4)},    { 16*3.75,  32}, 0},
-    {{2|(2<<4)},    { 16*2.75,  32}, 0},
-    {{2|(1<<4)},    { 16*1.75,  32}, 0},
+    {{2|(11<<4)},   {16*11.75,  32}, 4},
+    {{2|(10<<4)},   {16*10.75,  32}, 4},
+    {{2|(9<<4)},    {16*9.75,  32}, 4},
+    {{2|(8<<4)},    {16*8.75,  32}, 4},
+    {{2|(7<<4)},    {16*7.75,  32}, 4},
+       {{2|(6<<4)},    { 16*6.75,  32}, 4},
+    {{2|(5<<4)},    { 16*5.75,  32}, 4},
+    {{2|(4<<4)},    { 16*4.75,  32}, 4},
+    {{2|(3<<4)},    { 16*3.75,  32}, 4},
+    {{2|(2<<4)},    { 16*2.75,  32}, 4},
+    {{2|(1<<4)},    { 16*1.75,  32}, 4},
     {{2|(0<<4)},    { 16*0.375,  32}, 1},
     {{3|(11<<4)},   {16*13.125,  48}, 1},
-    {{3|(10<<4)},   {16*11.25,  48}, 0},
-    {{3|(9<<4)},    {16*10.25,  48}, 0},
-    {{3|(8<<4)},    {16*9.25,  48}, 0},
-    {{3|(7<<4)},    {16*8.25,  48}, 0},
-       {{3|(6<<4)},    {16*7.25,  48}, 0},
-    {{3|(5<<4)},    {16*6.25,  48}, 0},
-    {{3|(4<<4)},    {16*5.25,  48}, 0},
-    {{3|(3<<4)},    {16*4.25,  48}, 0},
-    {{3|(2<<4)},    {16*3.25,  48}, 0},
-    {{3|(1<<4)},    {16*1.25,  48}, 0},
+    {{3|(10<<4)},   {16*11.25,  48}, 4},
+    {{3|(9<<4)},    {16*10.25,  48}, 4},
+    {{3|(8<<4)},    {16*9.25,  48}, 4},
+    {{3|(7<<4)},    {16*8.25,  48}, 4},
+       {{3|(6<<4)},    {16*7.25,  48}, 4},
+    {{3|(5<<4)},    {16*6.25,  48}, 4},
+    {{3|(4<<4)},    {16*5.25,  48}, 4},
+    {{3|(3<<4)},    {16*4.25,  48}, 4},
+    {{3|(2<<4)},    {16*3.25,  48}, 4},
+    {{3|(1<<4)},    {16*1.25,  48}, 4},
     {{3|(0<<4)},    {16*0.625,  48}, 1},
        {{4|(13<<4)},   {16*13.875,  64}, 1},
     {{4|(11<<4)},   {16*12.625,  64}, 1},
     {{4|(10<<4)},   {16*11.375,  64}, 1},
     {{4|(9<<4)},    {16*10.125,  64}, 1},
-    {{4|(5<<4)},    { 16*6.375,  64}, 0},
+    {{4|(5<<4)},    { 16*6.375,  64}, 4},
     {{4|(2<<4)},    { 16*2.625,  64}, 1},
     {{4|(1<<4)},    { 16*1.375,  64}, 1},
     {{4|(0<<4)},    { 16*0.125,  64}, 1},
@@ -578,7 +582,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, H_16,   G_16,   I_16},
     {0, K_16,   J_16,   L_16},
 };
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(13<<4)},   {17.23*13,  0}, 1},
     {{0|(12<<4)},   {17.23*12,  0}, 1},
     {{0|(11<<4)},   {17.23*11,  0}, 1},
@@ -594,51 +599,51 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{0|(1<<4)},    { 17.23*1,  0}, 1},
     {{0|(0<<4)},    { 17.23*0,  0}, 1},
        {{1|(13<<4)},   {17.23*13,  16}, 1},
-    {{1|(12<<4)},   {17.23*12,  16}, 0},
-    {{1|(11<<4)},   {17.23*11,  16}, 0},
-    {{1|(10<<4)},   {17.23*10,  16}, 0},
-    {{1|(9<<4)},    {17.23*9,  16}, 0},
-    {{1|(8<<4)},    {17.23*8,  16}, 0},
-    {{1|(7<<4)},    {17.23*7,  16}, 0},
-       {{1|(6<<4)},    { 17.23*6,  16}, 0},
-    {{1|(5<<4)},    { 17.23*5,  16}, 0},
-    {{1|(4<<4)},    { 17.23*4,  16}, 0},
-    {{1|(3<<4)},    { 17.23*3,  16}, 0},
-    {{1|(2<<4)},    { 17.23*2,  16}, 0},
-    {{1|(1<<4)},    { 17.23*1,  16}, 0},
+    {{1|(12<<4)},   {17.23*12,  16}, 4},
+    {{1|(11<<4)},   {17.23*11,  16}, 4},
+    {{1|(10<<4)},   {17.23*10,  16}, 4},
+    {{1|(9<<4)},    {17.23*9,  16}, 4},
+    {{1|(8<<4)},    {17.23*8,  16}, 4},
+    {{1|(7<<4)},    {17.23*7,  16}, 4},
+       {{1|(6<<4)},    { 17.23*6,  16}, 4},
+    {{1|(5<<4)},    { 17.23*5,  16}, 4},
+    {{1|(4<<4)},    { 17.23*4,  16}, 4},
+    {{1|(3<<4)},    { 17.23*3,  16}, 4},
+    {{1|(2<<4)},    { 17.23*2,  16}, 4},
+    {{1|(1<<4)},    { 17.23*1,  16}, 4},
     {{1|(0<<4)},    { 17.23*0,  16}, 1},
        {{2|(13<<4)},   {17.23*13,  32}, 1},
-    {{2|(11<<4)},   {17.23*11,  32}, 0},
-    {{2|(10<<4)},   {17.23*10,  32}, 0},
-    {{2|(9<<4)},    {17.23*9,  32}, 0},
-    {{2|(8<<4)},    {17.23*8,  32}, 0},
-    {{2|(7<<4)},    {17.23*7,  32}, 0},
-       {{2|(6<<4)},    { 17.23*6,  32}, 0},
-    {{2|(5<<4)},    { 17.23*5,  32}, 0},
-    {{2|(4<<4)},    { 17.23*4,  32}, 0},
-    {{2|(3<<4)},    { 17.23*3,  32}, 0},
-    {{2|(2<<4)},    { 17.23*2,  32}, 0},
-    {{2|(1<<4)},    { 17.23*1,  32}, 0},
+    {{2|(11<<4)},   {17.23*11,  32}, 4},
+    {{2|(10<<4)},   {17.23*10,  32}, 4},
+    {{2|(9<<4)},    {17.23*9,  32}, 4},
+    {{2|(8<<4)},    {17.23*8,  32}, 4},
+    {{2|(7<<4)},    {17.23*7,  32}, 4},
+       {{2|(6<<4)},    { 17.23*6,  32}, 4},
+    {{2|(5<<4)},    { 17.23*5,  32}, 4},
+    {{2|(4<<4)},    { 17.23*4,  32}, 4},
+    {{2|(3<<4)},    { 17.23*3,  32}, 4},
+    {{2|(2<<4)},    { 17.23*2,  32}, 4},
+    {{2|(1<<4)},    { 17.23*1,  32}, 4},
     {{2|(0<<4)},    { 17.23*0,  32}, 1},
        {{3|(13<<4)},   {17.23*13,  48}, 1},
-    {{3|(11<<4)},   {17.23*11,  48}, 0},
-    {{3|(10<<4)},   {17.23*10,  48}, 0},
-    {{3|(9<<4)},    {17.23*9,  48}, 0},
-    {{3|(8<<4)},    {17.23*8,  48}, 0},
-    {{3|(7<<4)},    {17.23*7,  48}, 0},
-       {{3|(6<<4)},    { 17.23*6,  48}, 0},
-    {{3|(5<<4)},    { 17.23*5,  48}, 0},
-    {{3|(4<<4)},    { 17.23*4,  48}, 0},
-    {{3|(3<<4)},    { 17.23*3,  48}, 0},
-    {{3|(2<<4)},    { 17.23*2,  48}, 0},
-    {{3|(1<<4)},    { 17.23*1,  48}, 0},
+    {{3|(11<<4)},   {17.23*11,  48}, 4},
+    {{3|(10<<4)},   {17.23*10,  48}, 4},
+    {{3|(9<<4)},    {17.23*9,  48}, 4},
+    {{3|(8<<4)},    {17.23*8,  48}, 4},
+    {{3|(7<<4)},    {17.23*7,  48}, 4},
+       {{3|(6<<4)},    { 17.23*6,  48}, 4},
+    {{3|(5<<4)},    { 17.23*5,  48}, 4},
+    {{3|(4<<4)},    { 17.23*4,  48}, 4},
+    {{3|(3<<4)},    { 17.23*3,  48}, 4},
+    {{3|(2<<4)},    { 17.23*2,  48}, 4},
+    {{3|(1<<4)},    { 17.23*1,  48}, 4},
     {{3|(0<<4)},    { 17.23*0,  48}, 1},
        {{4|(13<<4)},   {17.23*13,  64}, 1},
     {{4|(11<<4)},   {17.23*11,  64}, 1},
     {{4|(10<<4)},   {17.23*10,  64}, 1},
     {{4|(9<<4)},    {17.23*9,  64}, 1},
     {{4|(8<<4)},    {17.23*8,  64}, 1},
-    {{4|(5<<4)},    { 17.23*5,  64}, 0},
+    {{4|(5<<4)},    { 17.23*5,  64}, 4},
     {{4|(2<<4)},    { 17.23*2,  64}, 1},
     {{4|(1<<4)},    { 17.23*1,  64}, 1},
     {{4|(0<<4)},    { 17.23*0,  64}, 1},
index fcdf29e4ee2bb1574ee8fd74ed31890fa228d7d2..741fc55fb9e67d37f8d0a3338577c76603f2b19c 100644 (file)
@@ -42,10 +42,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 );
     }
   }
 }
index 6ba3ac7e6c8281f9d6e6fc010f6a8d42fffa5d62..1f3807c3b7e1131cd2b23c87930ad195c7991088 100644 (file)
@@ -43,10 +43,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 );
     }
   }
 }
index 772eddf07c93d09920480260c8bb025d7bb0a4e4..4575eb19d5894b802500013ff4d05f5a278ee787 100644 (file)
@@ -43,10 +43,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 );
     }
   }
 }
index a78e23703bee12d836bfd4abf77acc3efba5230e..5e3884803592e5810f4eaa1d5bfb9519bc8328a0 100644 (file)
@@ -42,10 +42,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 );
     }
   }
 }
index 2784f6fa672d31b39d840270e39fa43028e5266a..3dfa7837444f161a41c54a5a381353a55d779c5f 100644 (file)
@@ -56,11 +56,9 @@ void rgb_matrix_layer_helper(uint8_t red, uint8_t green, uint8_t blue, bool defa
        
        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 );
                }
        }
 }
index 6f4ae9fed179a693a00aa6d21ee6f6bd7f6eb73b..13ea843022d04d763c002d589768967ebb6ec85d 100644 (file)
@@ -269,64 +269,64 @@ 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] = {
 
     /*{row | col << 4}
       |             {x=0..224, y=0..64}
-      |              |                    modifier
+      |              |                    flags
       |              |                    | */
-    {{ 8|(0<<4)},   {17.2* 8, 12.8*0}, 0}, // LED 1 on right > Key 6
-    {{ 9|(0<<4)},   {17.2* 9, 12.8*0}, 0}, // LED 2 > Key 7
-    {{10|(0<<4)},   {17.2*10, 12.8*0}, 0}, // LED 3 > Key 8
-    {{11|(0<<4)},   {17.2*11, 12.8*0}, 0}, // LED 4 > Key 9
-    {{12|(0<<4)},   {17.2*12, 12.8*0}, 0}, // LED 5 > Key 0
-
-    {{ 8|(1<<4)},   {17.2* 8, 12.8*1}, 0}, // LED 6
-    {{ 9|(1<<4)},   {17.2* 9, 12.8*1}, 0}, // LED 7
-    {{10|(1<<4)},   {17.2*10, 12.8*1}, 0}, // LED 8
-    {{11|(1<<4)},   {17.2*11, 12.8*1}, 0}, // LED 9
-    {{12|(1<<4)},   {17.2*12, 12.8*1}, 0}, // LED 10
-
-    {{ 8|(2<<4)},   {17.2* 8, 12.8*2}, 0}, // LED 11
-    {{ 9|(2<<4)},   {17.2* 9, 12.8*2}, 0}, // LED 12
-    {{10|(2<<4)},   {17.2*10, 12.8*2}, 0}, // LED 13
-    {{11|(2<<4)},   {17.2*11, 12.8*2}, 0}, // LED 14
-    {{12|(2<<4)},   {17.2*12, 12.8*2}, 0}, // LED 15
-
-    {{ 8|(3<<4)},   {17.2* 8, 12.8*3}, 0}, // LED 16
-    {{ 9|(3<<4)},   {17.2* 9, 12.8*3}, 0}, // LED 17
-    {{10|(3<<4)},   {17.2*10, 12.8*3}, 0}, // LED 18
-    {{11|(3<<4)},   {17.2*11, 12.8*3}, 0}, // LED 19
-    {{12|(3<<4)},   {17.2*12, 12.8*3}, 0}, // LED 20
+    {{ 8|(0<<4)},   {17.2* 8, 12.8*0}, 4}, // LED 1 on right > Key 6
+    {{ 9|(0<<4)},   {17.2* 9, 12.8*0}, 4}, // LED 2 > Key 7
+    {{10|(0<<4)},   {17.2*10, 12.8*0}, 4}, // LED 3 > Key 8
+    {{11|(0<<4)},   {17.2*11, 12.8*0}, 4}, // LED 4 > Key 9
+    {{12|(0<<4)},   {17.2*12, 12.8*0}, 4}, // LED 5 > Key 0
+
+    {{ 8|(1<<4)},   {17.2* 8, 12.8*1}, 4}, // LED 6
+    {{ 9|(1<<4)},   {17.2* 9, 12.8*1}, 4}, // LED 7
+    {{10|(1<<4)},   {17.2*10, 12.8*1}, 4}, // LED 8
+    {{11|(1<<4)},   {17.2*11, 12.8*1}, 4}, // LED 9
+    {{12|(1<<4)},   {17.2*12, 12.8*1}, 4}, // LED 10
+
+    {{ 8|(2<<4)},   {17.2* 8, 12.8*2}, 4}, // LED 11
+    {{ 9|(2<<4)},   {17.2* 9, 12.8*2}, 4}, // LED 12
+    {{10|(2<<4)},   {17.2*10, 12.8*2}, 4}, // LED 13
+    {{11|(2<<4)},   {17.2*11, 12.8*2}, 4}, // LED 14
+    {{12|(2<<4)},   {17.2*12, 12.8*2}, 4}, // LED 15
+
+    {{ 8|(3<<4)},   {17.2* 8, 12.8*3}, 4}, // LED 16
+    {{ 9|(3<<4)},   {17.2* 9, 12.8*3}, 4}, // LED 17
+    {{10|(3<<4)},   {17.2*10, 12.8*3}, 4}, // LED 18
+    {{11|(3<<4)},   {17.2*11, 12.8*3}, 4}, // LED 19
+    {{12|(3<<4)},   {17.2*12, 12.8*3}, 4}, // LED 20
 
     {{ 9|(4<<4)},   {17.2* 9, 12.8*4}, 1}, // LED 21
     {{10|(4<<4)},   {17.2*10, 12.8*4}, 1}, // LED 22
     {{11|(4<<4)},   {17.2*11, 12.8*4}, 1}, // LED 23
     {{12|(4<<4)},   {17.2*12, 12.8*4}, 1}, // LED 24
 
-    {{ 5|(0<<4)},   {17.2* 5, 12.8*0}, 0}, // LED 1 on left > Key 5
-    {{ 4|(0<<4)},   {17.2* 4, 12.8*0}, 0}, // LED 2 > Key 4
-    {{ 3|(0<<4)},   {17.2* 3, 12.8*0}, 0}, // LED 3 > Key 3
-    {{ 2|(0<<4)},   {17.2* 2, 12.8*0}, 0}, // LED 4 > Key 2
-    {{ 1|(0<<4)},   {17.2* 1, 12.8*0}, 0}, // LED 5 > Key 1
-
-    {{ 5|(1<<4)},   {17.2* 5, 12.8*1}, 0}, // LED 6
-    {{ 4|(1<<4)},   {17.2* 4, 12.8*1}, 0}, // LED 7
-    {{ 3|(1<<4)},   {17.2* 3, 12.8*1}, 0}, // LED 8
-    {{ 2|(1<<4)},   {17.2* 2, 12.8*1}, 0}, // LED 9
-    {{ 1|(1<<4)},   {17.2* 1, 12.8*1}, 0}, // LED 10
-
-    {{ 5|(2<<4)},   {17.2* 5, 12.8*2}, 0}, // LED 11
-    {{ 4|(2<<4)},   {17.2* 4, 12.8*2}, 0}, // LED 12
-    {{ 3|(2<<4)},   {17.2* 3, 12.8*2}, 0}, // LED 13
-    {{ 2|(2<<4)},   {17.2* 2, 12.8*2}, 0}, // LED 14
-    {{ 1|(2<<4)},   {17.2* 1, 12.8*2}, 0}, // LED 15
-
-    {{ 5|(3<<4)},   {17.2* 5, 12.8*3}, 0}, // LED 16
-    {{ 4|(3<<4)},   {17.2* 4, 12.8*3}, 0}, // LED 17
-    {{ 3|(3<<4)},   {17.2* 3, 12.8*3}, 0}, // LED 18
-    {{ 2|(3<<4)},   {17.2* 2, 12.8*3}, 0}, // LED 19
-    {{ 1|(3<<4)},   {17.2* 1, 12.8*3}, 0}, // LED 20
+    {{ 5|(0<<4)},   {17.2* 5, 12.8*0}, 4}, // LED 1 on left > Key 5
+    {{ 4|(0<<4)},   {17.2* 4, 12.8*0}, 4}, // LED 2 > Key 4
+    {{ 3|(0<<4)},   {17.2* 3, 12.8*0}, 4}, // LED 3 > Key 3
+    {{ 2|(0<<4)},   {17.2* 2, 12.8*0}, 4}, // LED 4 > Key 2
+    {{ 1|(0<<4)},   {17.2* 1, 12.8*0}, 4}, // LED 5 > Key 1
+
+    {{ 5|(1<<4)},   {17.2* 5, 12.8*1}, 4}, // LED 6
+    {{ 4|(1<<4)},   {17.2* 4, 12.8*1}, 4}, // LED 7
+    {{ 3|(1<<4)},   {17.2* 3, 12.8*1}, 4}, // LED 8
+    {{ 2|(1<<4)},   {17.2* 2, 12.8*1}, 4}, // LED 9
+    {{ 1|(1<<4)},   {17.2* 1, 12.8*1}, 4}, // LED 10
+
+    {{ 5|(2<<4)},   {17.2* 5, 12.8*2}, 4}, // LED 11
+    {{ 4|(2<<4)},   {17.2* 4, 12.8*2}, 4}, // LED 12
+    {{ 3|(2<<4)},   {17.2* 3, 12.8*2}, 4}, // LED 13
+    {{ 2|(2<<4)},   {17.2* 2, 12.8*2}, 4}, // LED 14
+    {{ 1|(2<<4)},   {17.2* 1, 12.8*2}, 4}, // LED 15
+
+    {{ 5|(3<<4)},   {17.2* 5, 12.8*3}, 4}, // LED 16
+    {{ 4|(3<<4)},   {17.2* 4, 12.8*3}, 4}, // LED 17
+    {{ 3|(3<<4)},   {17.2* 3, 12.8*3}, 4}, // LED 18
+    {{ 2|(3<<4)},   {17.2* 2, 12.8*3}, 4}, // LED 19
+    {{ 1|(3<<4)},   {17.2* 1, 12.8*3}, 4}, // LED 20
 
     {{ 4|(4<<4)},   {17.2* 4, 12.8*4}, 1}, // LED 21
     {{ 3|(4<<4)},   {17.2* 3, 12.8*4}, 1}, // LED 22
index d50af86b51b97d69a31fb00a1ce653cbd198ace0..42f8799904f2ce5c48305741f154a327da8f7c6a 100644 (file)
@@ -114,80 +114,80 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {0, E_16,   D_16,   F_16},
     {0, B_16,   A_16,   C_16},
 };
-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
  *    |              |         | */
 //cs1
     {{0|(0<<4)},    {  0,  0}, 1},
-    {{0|(1<<4)},    { 17,  0}, 0},
+    {{0|(1<<4)},    { 17,  0}, 4},
     {{1|(0<<4)},    {  0, 16}, 1},
     {{2|(0<<4)},    {  0, 32}, 1},
 
 //cs2
-    {{0|(2<<4)},    { 34,  0}, 0},
-    {{0|(3<<4)},    { 51,  0}, 0},
-    {{1|(1<<4)},    { 17, 16}, 0},
-    {{1|(2<<4)},    { 34, 16}, 0},
+    {{0|(2<<4)},    { 34,  0}, 4},
+    {{0|(3<<4)},    { 51,  0}, 4},
+    {{1|(1<<4)},    { 17, 16}, 4},
+    {{1|(2<<4)},    { 34, 16}, 4},
 //cs3
-    {{2|(1<<4)},    { 17, 32}, 0},
-    {{2|(2<<4)},    { 34, 32}, 0},
-    {{3|(1<<4)},    { 17, 48}, 0},
-    {{3|(2<<4)},    { 34, 48}, 0},
+    {{2|(1<<4)},    { 17, 32}, 4},
+    {{2|(2<<4)},    { 34, 32}, 4},
+    {{3|(1<<4)},    { 17, 48}, 4},
+    {{3|(2<<4)},    { 34, 48}, 4},
 //cs4
-    {{0|(4<<4)},    { 68,  0}, 0},
-    {{0|(5<<4)},    { 85,  0}, 0},
-    {{1|(3<<4)},    { 51, 16}, 0},
-    {{1|(4<<4)},    { 68, 16}, 0},
+    {{0|(4<<4)},    { 68,  0}, 4},
+    {{0|(5<<4)},    { 85,  0}, 4},
+    {{1|(3<<4)},    { 51, 16}, 4},
+    {{1|(4<<4)},    { 68, 16}, 4},
 //cs5
-    {{0|(11<<4)},   {187,  0}, 0},
-    {{0|(12<<4)},   {204,  0}, 0},
-    {{1|(11<<4)},   {187, 16}, 0},
-    {{1|(12<<4)},   {204, 16}, 0},
+    {{0|(11<<4)},   {187,  0}, 4},
+    {{0|(12<<4)},   {204,  0}, 4},
+    {{1|(11<<4)},   {187, 16}, 4},
+    {{1|(12<<4)},   {204, 16}, 4},
 //cs6
-    {{0|(7<<4)},    {119,  0}, 0},
-    {{0|(8<<4)},    {136,  0}, 0},
-    {{1|(7<<4)},    {119, 16}, 0},
-    {{1|(8<<4)},    {136, 16}, 0},
+    {{0|(7<<4)},    {119,  0}, 4},
+    {{0|(8<<4)},    {136,  0}, 4},
+    {{1|(7<<4)},    {119, 16}, 4},
+    {{1|(8<<4)},    {136, 16}, 4},
 //cs7
-    {{0|(9<<4)},    {153,  0}, 0},
-    {{0|(10<<4)},   {170,  0}, 0},
-    {{1|(9<<4)},    {153, 16}, 0},
-    {{1|(10<<4)},   {170, 16}, 0},
+    {{0|(9<<4)},    {153,  0}, 4},
+    {{0|(10<<4)},   {170,  0}, 4},
+    {{1|(9<<4)},    {153, 16}, 4},
+    {{1|(10<<4)},   {170, 16}, 4},
 //cs8
-    {{0|(13<<4)},   {221,  0}, 0},
-    {{0|(14<<4)},   {221,  0}, 0},
+    {{0|(13<<4)},   {221,  0}, 4},
+    {{0|(14<<4)},   {221,  0}, 4},
     {{1|(13<<4)},   {221, 32}, 1},
     {{2|(12<<4)},   {221, 16}, 1},
 //cs9
-    {{2|(3<<4)},    { 51, 32}, 0},
-    {{2|(4<<4)},    { 68, 32}, 0},
-    {{3|(3<<4)},    { 51, 48}, 0},
-    {{3|(4<<4)},    { 68, 48}, 0},
+    {{2|(3<<4)},    { 51, 32}, 4},
+    {{2|(4<<4)},    { 68, 32}, 4},
+    {{3|(3<<4)},    { 51, 48}, 4},
+    {{3|(4<<4)},    { 68, 48}, 4},
 //cs10
-    {{0|(6<<4)},    {102,  0}, 0},
-    {{1|(5<<4)},    { 85, 16}, 0},
-    {{1|(6<<4)},    {102, 16}, 0},
-    {{2|(5<<4)},    { 85, 32}, 0},
+    {{0|(6<<4)},    {102,  0}, 4},
+    {{1|(5<<4)},    { 85, 16}, 4},
+    {{1|(6<<4)},    {102, 16}, 4},
+    {{2|(5<<4)},    { 85, 32}, 4},
 //cs11
-    {{2|(6<<4)},    {102, 32}, 0},
-    {{3|(5<<4)},    { 85, 48}, 0},
-    {{3|(6<<4)},    {102, 48}, 0},
-    {{4|(5<<4)},    {102, 64}, 0},
+    {{2|(6<<4)},    {102, 32}, 4},
+    {{3|(5<<4)},    { 85, 48}, 4},
+    {{3|(6<<4)},    {102, 48}, 4},
+    {{4|(5<<4)},    {102, 64}, 4},
 //cs12
-    {{2|(7<<4)},    {119, 32}, 0},
-    {{2|(8<<4)},    {136, 32}, 0},
-    {{3|(7<<4)},    {119, 48}, 0},
-    {{3|(8<<4)},    {136, 48}, 0},
+    {{2|(7<<4)},    {119, 32}, 4},
+    {{2|(8<<4)},    {136, 32}, 4},
+    {{3|(7<<4)},    {119, 48}, 4},
+    {{3|(8<<4)},    {136, 48}, 4},
 //cs13
-    {{2|(9<<4)},    {153, 32}, 0},
-    {{2|(10<<4)},   {170, 32}, 0},
-    {{3|(9<<4)},    {153, 48}, 0},
+    {{2|(9<<4)},    {153, 32}, 4},
+    {{2|(10<<4)},   {170, 32}, 4},
+    {{3|(9<<4)},    {153, 48}, 4},
     {{4|(6<<4)},    {136, 48}, 1},
 //cs14
-    {{2|(11<<4)},   {187, 32}, 0},
-    {{3|(10<<4)},   {170, 48}, 0},
+    {{2|(11<<4)},   {187, 32}, 4},
+    {{3|(10<<4)},   {170, 48}, 4},
     {{3|(11<<4)},   {187, 48}, 1},
     {{4|(7<<4)},    {153, 48}, 1},
 //cs15
index e99ed11a779289c7f527b30055bf3c955414281f..5827b42e20f370c5d05363ab25d431589ea281b1 100644 (file)
 #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|(13<<4)},   {195, 3},  0},
-  {{4|(13<<4)},   {195, 16}, 0},
-  {{4|(10<<4)},   {150, 16}, 0},
-  {{4|(7<<4)},    {105, 16}, 0},
-  {{4|(4<<4)},    {60,  16}, 0},
-  {{4|(1<<4)},    {15,  16}, 0},
-  {{1|(1<<4)},    {15,  3},  0},
-  {{1|(4<<4)},    {60,  3},  0},
-  {{1|(7<<4)},    {105, 3},  0},
-  {{1|(10<<4)},   {150, 3},  0}
+  {{1|(13<<4)},   {195, 3},  4},
+  {{4|(13<<4)},   {195, 16}, 4},
+  {{4|(10<<4)},   {150, 16}, 4},
+  {{4|(7<<4)},    {105, 16}, 4},
+  {{4|(4<<4)},    {60,  16}, 4},
+  {{4|(1<<4)},    {15,  16}, 4},
+  {{1|(1<<4)},    {15,  3},  4},
+  {{1|(4<<4)},    {60,  3},  4},
+  {{1|(7<<4)},    {105, 3},  4},
+  {{1|(10<<4)},   {150, 3},  4}
 };
 
 #endif
index 882611030b62f5507c4487581470d206d89fe500..bd6dd19b2a781ca77c39292a45ecc570d68e58ba 100644 (file)
@@ -165,7 +165,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {1, C9_16,  C7_15,  C6_15}  //D16
 };
 
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
 //
 //  C7,  C6,  C5,  C4,  C3,  C2,  C1,  A7,  A6,  A5,  A4,  A3,  A2,  A1,
 //  C8,  C9, C10, C11, C12, C13, C14,  A8,  A9, A10, A11, A12, A13, A15,
@@ -174,70 +174,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
 // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11
 /* {row | col << 4}
  *    |           {x=0..224, y=0..64}
- *    |              |            modifier
+ *    |              |            flags
  *    |              |         | */
     {{0|(13<<4)},   {224,  0}, 1}, //A1-A16
-    {{0|(12<<4)},   {204,  0}, 0},
-    {{0|(11<<4)},   {187,  0}, 0},
-    {{0|(10<<4)},   {170,  0}, 0},
-    {{0|(9<<4)},    {153,  0}, 0},
-    {{0|(8<<4)},    {136,  0}, 0},
-    {{0|(7<<4)},    {119,  0}, 0},
-    {{1|(7<<4)},    {119, 16}, 0},
-    {{1|(8<<4)},    {136, 16}, 0},
-    {{1|(9<<4)},    {153, 16}, 0},
-    {{1|(10<<4)},   {170, 16}, 0},
-    {{1|(11<<4)},   {187, 16}, 0},
-    {{1|(12<<4)},   {204, 16}, 0},
+    {{0|(12<<4)},   {204,  0}, 4},
+    {{0|(11<<4)},   {187,  0}, 4},
+    {{0|(10<<4)},   {170,  0}, 4},
+    {{0|(9<<4)},    {153,  0}, 4},
+    {{0|(8<<4)},    {136,  0}, 4},
+    {{0|(7<<4)},    {119,  0}, 4},
+    {{1|(7<<4)},    {119, 16}, 4},
+    {{1|(8<<4)},    {136, 16}, 4},
+    {{1|(9<<4)},    {153, 16}, 4},
+    {{1|(10<<4)},   {170, 16}, 4},
+    {{1|(11<<4)},   {187, 16}, 4},
+    {{1|(12<<4)},   {204, 16}, 4},
     {{2|(13<<4)},   {224, 32}, 1},
-    {{2|(12<<4)},   {224, 16}, 0},
-    {{2|(11<<4)},   {197, 32}, 0},
-
-    {{3|(10<<4)},   {170, 48}, 0}, //B1-B14
-    {{3|(9<<4)},    {153, 48}, 0},
-    {{3|(8<<4)},    {136, 48}, 0},
-    {{3|(7<<4)},    {119, 48}, 0},
-    {{2|(7<<4)},    {119, 32}, 0},
-    {{2|(8<<4)},    {136, 32}, 0},
-    {{2|(9<<4)},    {153, 32}, 0},
-    {{2|(10<<4)},   {170, 32}, 0},
-    {{3|(11<<4)},   {187, 48}, 0},
+    {{2|(12<<4)},   {224, 16}, 4},
+    {{2|(11<<4)},   {197, 32}, 4},
+
+    {{3|(10<<4)},   {170, 48}, 4}, //B1-B14
+    {{3|(9<<4)},    {153, 48}, 4},
+    {{3|(8<<4)},    {136, 48}, 4},
+    {{3|(7<<4)},    {119, 48}, 4},
+    {{2|(7<<4)},    {119, 32}, 4},
+    {{2|(8<<4)},    {136, 32}, 4},
+    {{2|(9<<4)},    {153, 32}, 4},
+    {{2|(10<<4)},   {170, 32}, 4},
+    {{3|(11<<4)},   {187, 48}, 4},
     {{3|(13<<4)},   {214, 48}, 1},
     {{4|(13<<4)},   {224, 64}, 1},
     {{4|(12<<4)},   {204, 64}, 1},
     {{4|(11<<4)},   {187, 64}, 1},
     {{4|(10<<4)},   {170, 64}, 1},
 
-    {{0|(6<<4)},    {102,  0}, 0}, //C1-C16
-    {{0|(5<<4)},    { 85,  0}, 0},
-    {{0|(4<<4)},    { 68,  0}, 0},
-    {{0|(3<<4)},    { 51,  0}, 0},
-    {{0|(2<<4)},    { 34,  0}, 0},
-    {{0|(1<<4)},    { 17,  0}, 0},
+    {{0|(6<<4)},    {102,  0}, 4}, //C1-C16
+    {{0|(5<<4)},    { 85,  0}, 4},
+    {{0|(4<<4)},    { 68,  0}, 4},
+    {{0|(3<<4)},    { 51,  0}, 4},
+    {{0|(2<<4)},    { 34,  0}, 4},
+    {{0|(1<<4)},    { 17,  0}, 4},
     {{0|(0<<4)},    {  0,  0}, 1},
     {{1|(0<<4)},    {  0, 16}, 1},
-    {{1|(1<<4)},    { 17, 16}, 0},
-    {{1|(2<<4)},    { 34, 16}, 0},
-    {{1|(3<<4)},    { 51, 16}, 0},
-    {{1|(4<<4)},    { 68, 16}, 0},
-    {{1|(5<<4)},    { 85, 16}, 0},
-    {{1|(6<<4)},    {102, 16}, 0},
-    {{2|(6<<4)},    {102, 32}, 0},
-    {{2|(5<<4)},    { 85, 32}, 0},
-
-    {{3|(2<<4)},    { 32, 48}, 0}, //D1-D16
+    {{1|(1<<4)},    { 17, 16}, 4},
+    {{1|(2<<4)},    { 34, 16}, 4},
+    {{1|(3<<4)},    { 51, 16}, 4},
+    {{1|(4<<4)},    { 68, 16}, 4},
+    {{1|(5<<4)},    { 85, 16}, 4},
+    {{1|(6<<4)},    {102, 16}, 4},
+    {{2|(6<<4)},    {102, 32}, 4},
+    {{2|(5<<4)},    { 85, 32}, 4},
+
+    {{3|(2<<4)},    { 32, 48}, 4}, //D1-D16
     //D2
     {{3|(0<<4)},    { 10, 48}, 1},
     {{2|(0<<4)},    {  0, 32}, 1},
-    {{2|(1<<4)},    { 17, 32}, 0},
-    {{2|(2<<4)},    { 34, 32}, 0},
-    {{2|(3<<4)},    { 51, 32}, 0},
-    {{2|(4<<4)},    { 68, 32}, 0},
-    {{3|(3<<4)},    { 51, 48}, 0},
-    {{3|(4<<4)},    { 68, 48}, 0},
-    {{3|(5<<4)},    { 85, 48}, 0},
-    {{3|(6<<4)},    {102, 48}, 0},
-    {{4|(3<<4)},    {102, 64}, 0},
+    {{2|(1<<4)},    { 17, 32}, 4},
+    {{2|(2<<4)},    { 34, 32}, 4},
+    {{2|(3<<4)},    { 51, 32}, 4},
+    {{2|(4<<4)},    { 68, 32}, 4},
+    {{3|(3<<4)},    { 51, 48}, 4},
+    {{3|(4<<4)},    { 68, 48}, 4},
+    {{3|(5<<4)},    { 85, 48}, 4},
+    {{3|(6<<4)},    {102, 48}, 4},
+    {{4|(3<<4)},    {102, 64}, 4},
     {{4|(2<<4)},    { 34, 68}, 1},
     {{4|(1<<4)},    { 17, 68}, 1},
     {{4|(0<<4)},    {  0, 68}, 1}
@@ -319,7 +319,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {1, C9_16,  C7_15,  C6_15}  //D16
 };
 
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
 //
 //  C7,  C6,  C5,  C4,  C3,  C2,  C1,  A7,  A6,  A5,  A4,  A3,  A2,  A1,
 //  C8,  C9, C10, C11, C12, C13, C14,  A8,  A9, A10, A11, A12, A13, ---,
@@ -328,70 +328,70 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
 // D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11
 /* {row | col << 4}
  *    |           {x=0..224, y=0..64}
- *    |              |            modifier
+ *    |              |            flags
  *    |              |         | */
     {{0|(13<<4)},   {224,  0}, 1}, //A1-A16
-    {{0|(12<<4)},   {204,  0}, 0},
-    {{0|(11<<4)},   {187,  0}, 0},
-    {{0|(10<<4)},   {170,  0}, 0},
-    {{0|(9<<4)},    {153,  0}, 0},
-    {{0|(8<<4)},    {136,  0}, 0},
-    {{0|(7<<4)},    {119,  0}, 0},
-    {{1|(7<<4)},    {119, 16}, 0},
-    {{1|(8<<4)},    {136, 16}, 0},
-    {{1|(9<<4)},    {153, 16}, 0},
-    {{1|(10<<4)},   {170, 16}, 0},
-    {{1|(11<<4)},   {187, 16}, 0},
-    {{1|(12<<4)},   {204, 16}, 0},
+    {{0|(12<<4)},   {204,  0}, 4},
+    {{0|(11<<4)},   {187,  0}, 4},
+    {{0|(10<<4)},   {170,  0}, 4},
+    {{0|(9<<4)},    {153,  0}, 4},
+    {{0|(8<<4)},    {136,  0}, 4},
+    {{0|(7<<4)},    {119,  0}, 4},
+    {{1|(7<<4)},    {119, 16}, 4},
+    {{1|(8<<4)},    {136, 16}, 4},
+    {{1|(9<<4)},    {153, 16}, 4},
+    {{1|(10<<4)},   {170, 16}, 4},
+    {{1|(11<<4)},   {187, 16}, 4},
+    {{1|(12<<4)},   {204, 16}, 4},
     {{2|(13<<4)},   {224,  8}, 1},
-    {{2|(12<<4)},   {204, 32}, 0},
-    {{2|(11<<4)},   {187, 32}, 0},
-
-    {{3|(10<<4)},   {170, 48}, 0}, //B1-B14
-    {{3|(9<<4)},    {153, 48}, 0},
-    {{3|(8<<4)},    {136, 48}, 0},
-    {{3|(7<<4)},    {119, 48}, 0},
-    {{2|(7<<4)},    {119, 32}, 0},
-    {{2|(8<<4)},    {136, 32}, 0},
-    {{2|(9<<4)},    {153, 32}, 0},
-    {{2|(10<<4)},   {170, 32}, 0},
-    {{3|(11<<4)},   {187, 48}, 0},
+    {{2|(12<<4)},   {204, 32}, 4},
+    {{2|(11<<4)},   {187, 32}, 4},
+
+    {{3|(10<<4)},   {170, 48}, 4}, //B1-B14
+    {{3|(9<<4)},    {153, 48}, 4},
+    {{3|(8<<4)},    {136, 48}, 4},
+    {{3|(7<<4)},    {119, 48}, 4},
+    {{2|(7<<4)},    {119, 32}, 4},
+    {{2|(8<<4)},    {136, 32}, 4},
+    {{2|(9<<4)},    {153, 32}, 4},
+    {{2|(10<<4)},   {170, 32}, 4},
+    {{3|(11<<4)},   {187, 48}, 4},
     {{3|(13<<4)},   {214, 48}, 1},
     {{4|(13<<4)},   {224, 64}, 1},
     {{4|(12<<4)},   {204, 64}, 1},
     {{4|(11<<4)},   {187, 64}, 1},
     {{4|(10<<4)},   {170, 64}, 1},
 
-    {{0|(6<<4)},    {102,  0}, 0}, //C1-C16
-    {{0|(5<<4)},    { 85,  0}, 0},
-    {{0|(4<<4)},    { 68,  0}, 0},
-    {{0|(3<<4)},    { 51,  0}, 0},
-    {{0|(2<<4)},    { 34,  0}, 0},
-    {{0|(1<<4)},    { 17,  0}, 0},
+    {{0|(6<<4)},    {102,  0}, 4}, //C1-C16
+    {{0|(5<<4)},    { 85,  0}, 4},
+    {{0|(4<<4)},    { 68,  0}, 4},
+    {{0|(3<<4)},    { 51,  0}, 4},
+    {{0|(2<<4)},    { 34,  0}, 4},
+    {{0|(1<<4)},    { 17,  0}, 4},
     {{0|(0<<4)},    {  0,  0}, 1},
     {{1|(0<<4)},    {  0, 16}, 1},
-    {{1|(1<<4)},    { 17, 16}, 0},
-    {{1|(2<<4)},    { 34, 16}, 0},
-    {{1|(3<<4)},    { 51, 16}, 0},
-    {{1|(4<<4)},    { 68, 16}, 0},
-    {{1|(5<<4)},    { 85, 16}, 0},
-    {{1|(6<<4)},    {102, 16}, 0},
-    {{2|(6<<4)},    {102, 32}, 0},
-    {{2|(5<<4)},    { 85, 32}, 0},
-
-    {{3|(2<<4)},    { 32, 48}, 0}, //D1-D16
-    {{3|(1<<4)},    { 17, 48}, 0},
+    {{1|(1<<4)},    { 17, 16}, 4},
+    {{1|(2<<4)},    { 34, 16}, 4},
+    {{1|(3<<4)},    { 51, 16}, 4},
+    {{1|(4<<4)},    { 68, 16}, 4},
+    {{1|(5<<4)},    { 85, 16}, 4},
+    {{1|(6<<4)},    {102, 16}, 4},
+    {{2|(6<<4)},    {102, 32}, 4},
+    {{2|(5<<4)},    { 85, 32}, 4},
+
+    {{3|(2<<4)},    { 32, 48}, 4}, //D1-D16
+    {{3|(1<<4)},    { 17, 48}, 4},
     {{3|(0<<4)},    {  0, 48}, 1},
     {{2|(0<<4)},    {  0, 32}, 1},
-    {{2|(1<<4)},    { 17, 32}, 0},
-    {{2|(2<<4)},    { 34, 32}, 0},
-    {{2|(3<<4)},    { 51, 32}, 0},
-    {{2|(4<<4)},    { 68, 32}, 0},
-    {{3|(3<<4)},    { 51, 48}, 0},
-    {{3|(4<<4)},    { 68, 48}, 0},
-    {{3|(5<<4)},    { 85, 48}, 0},
-    {{3|(6<<4)},    {102, 48}, 0},
-    {{4|(3<<4)},    {102, 64}, 0},
+    {{2|(1<<4)},    { 17, 32}, 4},
+    {{2|(2<<4)},    { 34, 32}, 4},
+    {{2|(3<<4)},    { 51, 32}, 4},
+    {{2|(4<<4)},    { 68, 32}, 4},
+    {{3|(3<<4)},    { 51, 48}, 4},
+    {{3|(4<<4)},    { 68, 48}, 4},
+    {{3|(5<<4)},    { 85, 48}, 4},
+    {{3|(6<<4)},    {102, 48}, 4},
+    {{4|(3<<4)},    {102, 64}, 4},
     {{4|(2<<4)},    { 34, 68}, 1},
     {{4|(1<<4)},    { 17, 68}, 1},
     {{4|(0<<4)},    {  0, 68}, 1}
index f63c38bf6f853fbf240e52e920fce0af9f7ccb7e..59e66e1330713d3cfda511769690ec98d0a93337 100644 (file)
@@ -123,6 +123,5 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define RGB_MATRIX_KEYPRESSES
 #define RGB_MATRIX_LED_PROCESS_LIMIT 15
 #define RGB_MATRIX_LED_FLUSH_LIMIT 10
-#define RGB_MATRIX_EXTRA_TOG
 
 #include "config_led.h"
index 7d98e47c907b749465bed51732f3794a397b67b5..1a9a539a076aeb90fb44d66966920a8fc2b1141a 100644 (file)
 //
 // There is a quick-and-dirty implementation of this under ledvis.html
 
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
-  /*  0 */ { { (0)|(0  << 4) }, { 8,   56 }, 0 }, // KC_ESC
-  /*  1 */ { { (0)|(1  << 4) }, { 22,  56 }, 0 }, // KC_1
-  /*  2 */ { { (0)|(2  << 4) }, { 35,  56 }, 0 }, // KC_2
-  /*  3 */ { { (0)|(3  << 4) }, { 49,  56 }, 0 }, // KC_3
-  /*  4 */ { { (0)|(4  << 4) }, { 63,  56 }, 0 }, // KC_4
-  /*  5 */ { { (0)|(5  << 4) }, { 77,  56 }, 0 }, // KC_5
-  /*  6 */ { { (0)|(6  << 4) }, { 91,  56 }, 0 }, // KC_6
-  /*  7 */ { { (0)|(7  << 4) }, { 105, 56 }, 0 }, // KC_7
-  /*  8 */ { { (0)|(8  << 4) }, { 118, 56 }, 0 }, // KC_8
-  /*  9 */ { { (0)|(9  << 4) }, { 132, 56 }, 0 }, // KC_9
-  /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 0 }, // KC_0
-  /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 0 }, // KC_MINS
-  /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 0 }, // KC_EQL
-  /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 0 }, // KC_BSPC
-  /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 0 }, // KC_DEL
-  /* 15 */ { { (1)|(0  << 4) }, { 11,  44 }, 0 }, // KC_TAB
-  /* 16 */ { { (1)|(1  << 4) }, { 28,  44 }, 0 }, // KC_Q
-  /* 17 */ { { (1)|(2  << 4) }, { 42,  44 }, 0 }, // KC_W
-  /* 18 */ { { (1)|(3  << 4) }, { 56,  44 }, 0 }, // KC_E
-  /* 19 */ { { (1)|(4  << 4) }, { 70,  44 }, 0 }, // KC_R
-  /* 20 */ { { (1)|(5  << 4) }, { 84,  44 }, 0 }, // KC_T
-  /* 21 */ { { (1)|(6  << 4) }, { 98,  44 }, 0 }, // KC_Y
-  /* 22 */ { { (1)|(7  << 4) }, { 112, 44 }, 0 }, // KC_U
-  /* 23 */ { { (1)|(8  << 4) }, { 125, 44 }, 0 }, // KC_I
-  /* 24 */ { { (1)|(9  << 4) }, { 139, 44 }, 0 }, // KC_O
-  /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 0 }, // KC_P
-  /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 0 }, // KC_LBRC
-  /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 0 }, // KC_RBRC
-  /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 0 }, // KC_BSLS
-  /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 0 }, // KC_HOME
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+  /*  0 */ { { (0)|(0  << 4) }, { 8,   56 }, 4 }, // KC_ESC
+  /*  1 */ { { (0)|(1  << 4) }, { 22,  56 }, 4 }, // KC_1
+  /*  2 */ { { (0)|(2  << 4) }, { 35,  56 }, 4 }, // KC_2
+  /*  3 */ { { (0)|(3  << 4) }, { 49,  56 }, 4 }, // KC_3
+  /*  4 */ { { (0)|(4  << 4) }, { 63,  56 }, 4 }, // KC_4
+  /*  5 */ { { (0)|(5  << 4) }, { 77,  56 }, 4 }, // KC_5
+  /*  6 */ { { (0)|(6  << 4) }, { 91,  56 }, 4 }, // KC_6
+  /*  7 */ { { (0)|(7  << 4) }, { 105, 56 }, 4 }, // KC_7
+  /*  8 */ { { (0)|(8  << 4) }, { 118, 56 }, 4 }, // KC_8
+  /*  9 */ { { (0)|(9  << 4) }, { 132, 56 }, 4 }, // KC_9
+  /* 10 */ { { (0)|(10 << 4) }, { 146, 56 }, 4 }, // KC_0
+  /* 11 */ { { (0)|(11 << 4) }, { 160, 56 }, 4 }, // KC_MINS
+  /* 12 */ { { (0)|(12 << 4) }, { 174, 56 }, 4 }, // KC_EQL
+  /* 13 */ { { (0)|(13 << 4) }, { 195, 56 }, 4 }, // KC_BSPC
+  /* 14 */ { { (0)|(14 << 4) }, { 215, 56 }, 4 }, // KC_DEL
+  /* 15 */ { { (1)|(0  << 4) }, { 11,  44 }, 4 }, // KC_TAB
+  /* 16 */ { { (1)|(1  << 4) }, { 28,  44 }, 4 }, // KC_Q
+  /* 17 */ { { (1)|(2  << 4) }, { 42,  44 }, 4 }, // KC_W
+  /* 18 */ { { (1)|(3  << 4) }, { 56,  44 }, 4 }, // KC_E
+  /* 19 */ { { (1)|(4  << 4) }, { 70,  44 }, 4 }, // KC_R
+  /* 20 */ { { (1)|(5  << 4) }, { 84,  44 }, 4 }, // KC_T
+  /* 21 */ { { (1)|(6  << 4) }, { 98,  44 }, 4 }, // KC_Y
+  /* 22 */ { { (1)|(7  << 4) }, { 112, 44 }, 4 }, // KC_U
+  /* 23 */ { { (1)|(8  << 4) }, { 125, 44 }, 4 }, // KC_I
+  /* 24 */ { { (1)|(9  << 4) }, { 139, 44 }, 4 }, // KC_O
+  /* 25 */ { { (1)|(10 << 4) }, { 153, 44 }, 4 }, // KC_P
+  /* 26 */ { { (1)|(11 << 4) }, { 167, 44 }, 4 }, // KC_LBRC
+  /* 27 */ { { (1)|(12 << 4) }, { 181, 44 }, 4 }, // KC_RBRC
+  /* 28 */ { { (1)|(13 << 4) }, { 198, 44 }, 4 }, // KC_BSLS
+  /* 29 */ { { (1)|(14 << 4) }, { 215, 44 }, 4 }, // KC_HOME
   /* 30 */ { { (2)|(0  << 4) }, { 13,  32 }, 1 }, // KC_CAPS
-  /* 31 */ { { (2)|(1  << 4) }, { 32,  32 }, 0 }, // KC_A
-  /* 32 */ { { (2)|(2  << 4) }, { 46,  32 }, 0 }, // KC_S
-  /* 33 */ { { (2)|(3  << 4) }, { 60,  32 }, 0 }, // KC_D
-  /* 34 */ { { (2)|(4  << 4) }, { 73,  32 }, 0 }, // KC_F
-  /* 35 */ { { (2)|(5  << 4) }, { 87,  32 }, 0 }, // KC_G
-  /* 36 */ { { (2)|(6  << 4) }, { 101, 32 }, 0 }, // KC_H
-  /* 37 */ { { (2)|(7  << 4) }, { 115, 32 }, 0 }, // KC_J
-  /* 38 */ { { (2)|(8  << 4) }, { 129, 32 }, 0 }, // KC_K
-  /* 39 */ { { (2)|(9  << 4) }, { 143, 32 }, 0 }, // KC_L
-  /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 0 }, // KC_SCLN
-  /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 0 }, // KC_QUOT
+  /* 31 */ { { (2)|(1  << 4) }, { 32,  32 }, 4 }, // KC_A
+  /* 32 */ { { (2)|(2  << 4) }, { 46,  32 }, 4 }, // KC_S
+  /* 33 */ { { (2)|(3  << 4) }, { 60,  32 }, 4 }, // KC_D
+  /* 34 */ { { (2)|(4  << 4) }, { 73,  32 }, 4 }, // KC_F
+  /* 35 */ { { (2)|(5  << 4) }, { 87,  32 }, 4 }, // KC_G
+  /* 36 */ { { (2)|(6  << 4) }, { 101, 32 }, 4 }, // KC_H
+  /* 37 */ { { (2)|(7  << 4) }, { 115, 32 }, 4 }, // KC_J
+  /* 38 */ { { (2)|(8  << 4) }, { 129, 32 }, 4 }, // KC_K
+  /* 39 */ { { (2)|(9  << 4) }, { 143, 32 }, 4 }, // KC_L
+  /* 40 */ { { (2)|(10 << 4) }, { 156, 32 }, 4 }, // KC_SCLN
+  /* 41 */ { { (2)|(11 << 4) }, { 170, 32 }, 4 }, // KC_QUOT
   /* _________________________________________ */ // ____
-  /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 0 }, // KC_ENT
-  /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 0 }, // KC_PGUP
-  /* 44 */ { { (3)|(0  << 4) }, { 16,  19 }, 0 }, // KC_LSFT
-  /* 45 */ { { (3)|(2  << 4) }, { 39,  19 }, 0 }, // KC_Z
-  /* 46 */ { { (3)|(3  << 4) }, { 53,  19 }, 0 }, // KC_X
-  /* 47 */ { { (3)|(4  << 4) }, { 67,  19 }, 0 }, // KC_C
-  /* 48 */ { { (3)|(5  << 4) }, { 80,  19 }, 0 }, // KC_V
-  /* 49 */ { { (3)|(6  << 4) }, { 94,  19 }, 0 }, // KC_B
-  /* 50 */ { { (3)|(7  << 4) }, { 108, 19 }, 0 }, // KC_N
-  /* 51 */ { { (3)|(8  << 4) }, { 122, 19 }, 0 }, // KC_M
-  /* 52 */ { { (3)|(9  << 4) }, { 136, 19 }, 0 }, // KC_COMM
-  /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 0 }, // KC_DOT
-  /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 0 }, // KC_SLSH
-  /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 0 }, // KC_RSFT
+  /* 42 */ { { (2)|(13 << 4) }, { 193, 32 }, 4 }, // KC_ENT
+  /* 43 */ { { (2)|(14 << 4) }, { 215, 32 }, 4 }, // KC_PGUP
+  /* 44 */ { { (3)|(0  << 4) }, { 16,  19 }, 4 }, // KC_LSFT
+  /* 45 */ { { (3)|(2  << 4) }, { 39,  19 }, 4 }, // KC_Z
+  /* 46 */ { { (3)|(3  << 4) }, { 53,  19 }, 4 }, // KC_X
+  /* 47 */ { { (3)|(4  << 4) }, { 67,  19 }, 4 }, // KC_C
+  /* 48 */ { { (3)|(5  << 4) }, { 80,  19 }, 4 }, // KC_V
+  /* 49 */ { { (3)|(6  << 4) }, { 94,  19 }, 4 }, // KC_B
+  /* 50 */ { { (3)|(7  << 4) }, { 108, 19 }, 4 }, // KC_N
+  /* 51 */ { { (3)|(8  << 4) }, { 122, 19 }, 4 }, // KC_M
+  /* 52 */ { { (3)|(9  << 4) }, { 136, 19 }, 4 }, // KC_COMM
+  /* 53 */ { { (3)|(10 << 4) }, { 150, 19 }, 4 }, // KC_DOT
+  /* 54 */ { { (3)|(11 << 4) }, { 163, 19 }, 4 }, // KC_SLSH
+  /* 55 */ { { (3)|(12 << 4) }, { 182, 19 }, 4 }, // KC_RSFT
   /* _________________________________________ */ // ____
-  /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 0 }, // KC_UP
-  /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 0 }, // KC_PGDN
-  /* 58 */ { { (4)|(0  << 4) }, { 9,    7 }, 0 }, // KC_LCTL
-  /* 59 */ { { (4)|(1  << 4) }, { 27,   7 }, 0 }, // KC_LGUI
-  /* 60 */ { { (4)|(2  << 4) }, { 44,   7 }, 0 }, // KC_LALT
+  /* 56 */ { { (3)|(13 << 4) }, { 201, 19 }, 4 }, // KC_UP
+  /* 57 */ { { (3)|(14 << 4) }, { 215, 19 }, 4 }, // KC_PGDN
+  /* 58 */ { { (4)|(0  << 4) }, { 9,    7 }, 4 }, // KC_LCTL
+  /* 59 */ { { (4)|(1  << 4) }, { 27,   7 }, 4 }, // KC_LGUI
+  /* 60 */ { { (4)|(2  << 4) }, { 44,   7 }, 4 }, // KC_LALT
   /* _________________________________________ */ // ____
   /* _________________________________________ */ // ____
   /* _________________________________________ */ // ____
-  /* 61 */ { { (4)|(6  << 4) }, { 96,   7 }, 0 }, // KC_SPC
+  /* 61 */ { { (4)|(6  << 4) }, { 96,   7 }, 4 }, // KC_SPC
   /* _________________________________________ */ // ____
   /* _________________________________________ */ // ____
   /* _________________________________________ */ // ____
-  /* 62 */ { { (4)|(10 << 4) }, { 148,  7 }, 0 }, // KC_RALT
-  /* 63 */ { { (4)|(11 << 4) }, { 165,  7 }, 0 }, // MO(1)
-  /* 64 */ { { (4)|(12 << 4) }, { 188,  7 }, 0 }, // KC_LEFT
-  /* 65 */ { { (4)|(13 << 4) }, { 201,  7 }, 0 }, // KC_DOWN
-  /* 66 */ { { (4)|(14 << 4) }, { 215,  7 }, 0 }, // KC_RGHT
+  /* 62 */ { { (4)|(10 << 4) }, { 148,  7 }, 4 }, // KC_RALT
+  /* 63 */ { { (4)|(11 << 4) }, { 165,  7 }, 4 }, // MO(1)
+  /* 64 */ { { (4)|(12 << 4) }, { 188,  7 }, 4 }, // KC_LEFT
+  /* 65 */ { { (4)|(13 << 4) }, { 201,  7 }, 4 }, // KC_DOWN
+  /* 66 */ { { (4)|(14 << 4) }, { 215,  7 }, 4 }, // KC_RGHT
 
   // Underglow LEDs
-  { { 255 }, { 1,    1 }, 0 },
-  { { 255 }, { 15,   0 }, 0 },
-  { { 255 }, { 31,   0 }, 0 },
-  { { 255 }, { 47,   0 }, 0 },
-  { { 255 }, { 63,   0 }, 0 },
-  { { 255 }, { 79,   0 }, 0 },
-  { { 255 }, { 95,   0 }, 0 },
-  { { 255 }, { 112,  0 }, 0 },
-  { { 255 }, { 128,  0 }, 0 },
-  { { 255 }, { 144,  0 }, 0 },
-  { { 255 }, { 160,  0 }, 0 },
-  { { 255 }, { 176,  0 }, 0 },
-  { { 255 }, { 192,  0 }, 0 },
-  { { 255 }, { 208,  0 }, 0 },
-  { { 255 }, { 222,  1 }, 0 },
-  { { 255 }, { 224, 13 }, 0 },
-  { { 255 }, { 224, 25 }, 0 },
-  { { 255 }, { 224, 38 }, 0 },
-  { { 255 }, { 224, 50 }, 0 },
-  { { 255 }, { 222, 62 }, 0 },
-  { { 255 }, { 191, 64 }, 0 },
-  { { 255 }, { 179, 64 }, 0 },
-  { { 255 }, { 167, 64 }, 0 },
-  { { 255 }, { 153, 64 }, 0 },
-  { { 255 }, { 139, 64 }, 0 },
-  { { 255 }, { 125, 64 }, 0 },
-  { { 255 }, { 112, 64 }, 0 },
-  { { 255 }, { 98,  64 }, 0 },
-  { { 255 }, { 84,  64 }, 0 },
-  { { 255 }, { 70,  64 }, 0 },
-  { { 255 }, { 56,  64 }, 0 },
-  { { 255 }, { 42,  64 }, 0 },
-  { { 255 }, { 28,  64 }, 0 },
-  { { 255 }, { 1,   62 }, 0 },
-  { { 255 }, { 0,   50 }, 0 },
-  { { 255 }, { 0,   38 }, 0 },
-  { { 255 }, { 0,   25 }, 0 },
-  { { 255 }, { 0,   13 }, 0 },
+  { { 255 }, { 1,    1 }, 2 },
+  { { 255 }, { 15,   0 }, 2 },
+  { { 255 }, { 31,   0 }, 2 },
+  { { 255 }, { 47,   0 }, 2 },
+  { { 255 }, { 63,   0 }, 2 },
+  { { 255 }, { 79,   0 }, 2 },
+  { { 255 }, { 95,   0 }, 2 },
+  { { 255 }, { 112,  0 }, 2 },
+  { { 255 }, { 128,  0 }, 2 },
+  { { 255 }, { 144,  0 }, 2 },
+  { { 255 }, { 160,  0 }, 2 },
+  { { 255 }, { 176,  0 }, 2 },
+  { { 255 }, { 192,  0 }, 2 },
+  { { 255 }, { 208,  0 }, 2 },
+  { { 255 }, { 222,  1 }, 2 },
+  { { 255 }, { 224, 13 }, 2 },
+  { { 255 }, { 224, 25 }, 2 },
+  { { 255 }, { 224, 38 }, 2 },
+  { { 255 }, { 224, 50 }, 2 },
+  { { 255 }, { 222, 62 }, 2 },
+  { { 255 }, { 191, 64 }, 2 },
+  { { 255 }, { 179, 64 }, 2 },
+  { { 255 }, { 167, 64 }, 2 },
+  { { 255 }, { 153, 64 }, 2 },
+  { { 255 }, { 139, 64 }, 2 },
+  { { 255 }, { 125, 64 }, 2 },
+  { { 255 }, { 112, 64 }, 2 },
+  { { 255 }, { 98,  64 }, 2 },
+  { { 255 }, { 84,  64 }, 2 },
+  { { 255 }, { 70,  64 }, 2 },
+  { { 255 }, { 56,  64 }, 2 },
+  { { 255 }, { 42,  64 }, 2 },
+  { { 255 }, { 28,  64 }, 2 },
+  { { 255 }, { 1,   62 }, 2 },
+  { { 255 }, { 0,   50 }, 2 },
+  { { 255 }, { 0,   38 }, 2 },
+  { { 255 }, { 0,   25 }, 2 },
+  { { 255 }, { 0,   13 }, 2 },
 };
 
 #ifdef USB_LED_INDICATOR_ENABLE
index a4519d40490277e15c7932761c641a16e362ff2d..f6f79ad91ef96c77c7468ac27b3c85680f6c109b 100644 (file)
@@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }
index a4519d40490277e15c7932761c641a16e362ff2d..f6f79ad91ef96c77c7468ac27b3c85680f6c109b 100644 (file)
@@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }
index 26a1c6d0148876aec05df7043d8582fd6f01b420..222d7e2c504af9c59ef2ac6b9a993c9747779141 100644 (file)
@@ -95,6 +95,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }
index df2e509216310a5f6dad6bab4433462961d51dc3..9b9f98f5fe12aba96b01d71681d60a8509bf02ed 100644 (file)
@@ -123,6 +123,5 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define RGB_MATRIX_KEYPRESSES
 #define RGB_MATRIX_LED_PROCESS_LIMIT 15
 #define RGB_MATRIX_LED_FLUSH_LIMIT 10
-#define RGB_MATRIX_EXTRA_TOG
 
 #include "config_led.h"
index afdbf3a2227b4bd62d2d63742892d431be90ad88..20d9c649ec0afa5a44fd36afa39389f719209ad9 100644 (file)
 #include "rgb_matrix.h"
 #include "config_led.h"
 
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
   // KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS
-  { { 0|(0<<4) }, { 7, 5 }, 0 },
-  { { 0|(1<<4) }, { 31, 5 }, 0 },
-  { { 0|(2<<4) }, { 43, 5 }, 0 },
-  { { 0|(3<<4) }, { 55, 5 }, 0 },
-  { { 0|(4<<4) }, { 67, 5 }, 0 },
-  { { 0|(5<<4) }, { 85, 5 }, 0 },
-  { { 0|(6<<4) }, { 97, 5 }, 0 },
-  { { 0|(7<<4) }, { 109, 5 }, 0 },
-  { { 6|(0<<4) }, { 121, 5 }, 0 },
-  { { 6|(1<<4) }, { 139, 5 }, 0 },
-  { { 6|(2<<4) }, { 151, 5 }, 0 },
-  { { 6|(3<<4) }, { 163, 5 }, 0 },
-  { { 6|(4<<4) }, { 175, 5 }, 0 },
-  { { 6|(5<<4) }, { 193, 5 }, 0 },
+  { { 0|(0<<4) }, { 7, 5 }, 4 },
+  { { 0|(1<<4) }, { 31, 5 }, 4 },
+  { { 0|(2<<4) }, { 43, 5 }, 4 },
+  { { 0|(3<<4) }, { 55, 5 }, 4 },
+  { { 0|(4<<4) }, { 67, 5 }, 4 },
+  { { 0|(5<<4) }, { 85, 5 }, 4 },
+  { { 0|(6<<4) }, { 97, 5 }, 4 },
+  { { 0|(7<<4) }, { 109, 5 }, 4 },
+  { { 6|(0<<4) }, { 121, 5 }, 4 },
+  { { 6|(1<<4) }, { 139, 5 }, 4 },
+  { { 6|(2<<4) }, { 151, 5 }, 4 },
+  { { 6|(3<<4) }, { 163, 5 }, 4 },
+  { { 6|(4<<4) }, { 175, 5 }, 4 },
+  { { 6|(5<<4) }, { 193, 5 }, 4 },
   { { 6|(6<<4) }, { 205, 5 }, 1 },
-  { { 6|(7<<4) }, { 217, 5 }, 0 },
+  { { 6|(7<<4) }, { 217, 5 }, 4 },
   // KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP
-  { { 1|(0<<4) }, { 7, 20 }, 0 },
-  { { 1|(1<<4) }, { 19, 20 }, 0 },
-  { { 1|(2<<4) }, { 31, 20 }, 0 },
-  { { 1|(3<<4) }, { 43, 20 }, 0 },
-  { { 1|(4<<4) }, { 55, 20 }, 0 },
-  { { 1|(5<<4) }, { 67, 20 }, 0 },
-  { { 1|(6<<4) }, { 79, 20 }, 0 },
-  { { 1|(7<<4) }, { 91, 20 }, 0 },
-  { { 7|(0<<4) }, { 103, 20 }, 0 },
-  { { 7|(1<<4) }, { 115, 20 }, 0 },
-  { { 7|(2<<4) }, { 127, 20 }, 0 },
-  { { 7|(3<<4) }, { 139, 20 }, 0 },
-  { { 7|(4<<4) }, { 151, 20 }, 0 },
-  { { 7|(5<<4) }, { 169, 20 }, 0 },
-  { { 7|(6<<4) }, { 193, 20 }, 0 },
-  { { 7|(7<<4) }, { 205, 20 }, 0 },
-  { { 9|(7<<4) }, { 217, 20 }, 0 },
+  { { 1|(0<<4) }, { 7, 20 }, 4 },
+  { { 1|(1<<4) }, { 19, 20 }, 4 },
+  { { 1|(2<<4) }, { 31, 20 }, 4 },
+  { { 1|(3<<4) }, { 43, 20 }, 4 },
+  { { 1|(4<<4) }, { 55, 20 }, 4 },
+  { { 1|(5<<4) }, { 67, 20 }, 4 },
+  { { 1|(6<<4) }, { 79, 20 }, 4 },
+  { { 1|(7<<4) }, { 91, 20 }, 4 },
+  { { 7|(0<<4) }, { 103, 20 }, 4 },
+  { { 7|(1<<4) }, { 115, 20 }, 4 },
+  { { 7|(2<<4) }, { 127, 20 }, 4 },
+  { { 7|(3<<4) }, { 139, 20 }, 4 },
+  { { 7|(4<<4) }, { 151, 20 }, 4 },
+  { { 7|(5<<4) }, { 169, 20 }, 4 },
+  { { 7|(6<<4) }, { 193, 20 }, 4 },
+  { { 7|(7<<4) }, { 205, 20 }, 4 },
+  { { 9|(7<<4) }, { 217, 20 }, 4 },
   // KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN
-  { { 2|(0<<4) }, { 10, 30 }, 0 },
-  { { 2|(1<<4) }, { 25, 30 }, 0 },
-  { { 2|(2<<4) }, { 37, 30 }, 0 },
-  { { 2|(3<<4) }, { 49, 30 }, 0 },
-  { { 2|(4<<4) }, { 61, 30 }, 0 },
-  { { 2|(5<<4) }, { 73, 30 }, 0 },
-  { { 2|(6<<4) }, { 85, 30 }, 0 },
-  { { 2|(7<<4) }, { 97, 30 }, 0 },
-  { { 8|(0<<4) }, { 109, 30 }, 0 },
-  { { 8|(1<<4) }, { 121, 30 }, 0 },
-  { { 8|(2<<4) }, { 133, 30 }, 0 },
-  { { 8|(3<<4) }, { 145, 30 }, 0 },
-  { { 8|(4<<4) }, { 157, 30 }, 0 },
-  { { 8|(5<<4) }, { 172, 30 }, 0 },
-  { { 8|(6<<4) }, { 193, 30 }, 0 },
-  { { 8|(7<<4) }, { 205, 30 }, 0 },
-  { { 9|(6<<4) }, { 217, 30 }, 0 },
+  { { 2|(0<<4) }, { 10, 30 }, 4 },
+  { { 2|(1<<4) }, { 25, 30 }, 4 },
+  { { 2|(2<<4) }, { 37, 30 }, 4 },
+  { { 2|(3<<4) }, { 49, 30 }, 4 },
+  { { 2|(4<<4) }, { 61, 30 }, 4 },
+  { { 2|(5<<4) }, { 73, 30 }, 4 },
+  { { 2|(6<<4) }, { 85, 30 }, 4 },
+  { { 2|(7<<4) }, { 97, 30 }, 4 },
+  { { 8|(0<<4) }, { 109, 30 }, 4 },
+  { { 8|(1<<4) }, { 121, 30 }, 4 },
+  { { 8|(2<<4) }, { 133, 30 }, 4 },
+  { { 8|(3<<4) }, { 145, 30 }, 4 },
+  { { 8|(4<<4) }, { 157, 30 }, 4 },
+  { { 8|(5<<4) }, { 172, 30 }, 4 },
+  { { 8|(6<<4) }, { 193, 30 }, 4 },
+  { { 8|(7<<4) }, { 205, 30 }, 4 },
+  { { 9|(6<<4) }, { 217, 30 }, 4 },
   // KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT
   { { 3|(0<<4) }, { 11, 39 }, 1 },
-  { { 3|(1<<4) }, { 28, 39 }, 0 },
-  { { 3|(2<<4) }, { 40, 39 }, 0 },
-  { { 3|(3<<4) }, { 52, 39 }, 0 },
-  { { 3|(4<<4) }, { 64, 39 }, 0 },
-  { { 3|(5<<4) }, { 76, 39 }, 0 },
-  { { 3|(6<<4) }, { 88, 39 }, 0 },
-  { { 3|(7<<4) }, { 100, 39 }, 0 },
-  { { 9|(0<<4) }, { 112, 39 }, 0 },
-  { { 9|(1<<4) }, { 124, 39 }, 0 },
-  { { 9|(2<<4) }, { 136, 39 }, 0 },
-  { { 9|(3<<4) }, { 148, 39 }, 0 },
-  { { 9|(4<<4) }, { 168, 39 }, 0 },
+  { { 3|(1<<4) }, { 28, 39 }, 4 },
+  { { 3|(2<<4) }, { 40, 39 }, 4 },
+  { { 3|(3<<4) }, { 52, 39 }, 4 },
+  { { 3|(4<<4) }, { 64, 39 }, 4 },
+  { { 3|(5<<4) }, { 76, 39 }, 4 },
+  { { 3|(6<<4) }, { 88, 39 }, 4 },
+  { { 3|(7<<4) }, { 100, 39 }, 4 },
+  { { 9|(0<<4) }, { 112, 39 }, 4 },
+  { { 9|(1<<4) }, { 124, 39 }, 4 },
+  { { 9|(2<<4) }, { 136, 39 }, 4 },
+  { { 9|(3<<4) }, { 148, 39 }, 4 },
+  { { 9|(4<<4) }, { 168, 39 }, 4 },
   // KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP
-  { { 4|(0<<4) }, { 14, 49 }, 0 },
-  { { 4|(1<<4) }, { 34, 49 }, 0 },
-  { { 4|(2<<4) }, { 46, 49 }, 0 },
-  { { 4|(3<<4) }, { 58, 49 }, 0 },
-  { { 4|(4<<4) }, { 70, 49 }, 0 },
-  { { 4|(5<<4) }, { 82, 49 }, 0 },
-  { { 4|(6<<4) }, { 94, 49 }, 0 },
-  { { 4|(7<<4) }, { 106, 49 }, 0 },
-  { { 10|(0<<4) }, { 118, 49 }, 0 },
-  { { 10|(1<<4) }, { 130, 49 }, 0 },
-  { { 10|(2<<4) }, { 142, 49 }, 0 },
-  { { 10|(3<<4) }, { 165, 49 }, 0 },
-  { { 9|(5<<4) }, { 205, 49 }, 0 },
+  { { 4|(0<<4) }, { 14, 49 }, 4 },
+  { { 4|(1<<4) }, { 34, 49 }, 4 },
+  { { 4|(2<<4) }, { 46, 49 }, 4 },
+  { { 4|(3<<4) }, { 58, 49 }, 4 },
+  { { 4|(4<<4) }, { 70, 49 }, 4 },
+  { { 4|(5<<4) }, { 82, 49 }, 4 },
+  { { 4|(6<<4) }, { 94, 49 }, 4 },
+  { { 4|(7<<4) }, { 106, 49 }, 4 },
+  { { 10|(0<<4) }, { 118, 49 }, 4 },
+  { { 10|(1<<4) }, { 130, 49 }, 4 },
+  { { 10|(2<<4) }, { 142, 49 }, 4 },
+  { { 10|(3<<4) }, { 165, 49 }, 4 },
+  { { 9|(5<<4) }, { 205, 49 }, 4 },
   // KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
-  { { 5|(0<<4) }, { 8, 59 }, 0 },
-  { { 5|(1<<4) }, { 23, 59 }, 0 },
-  { { 5|(2<<4) }, { 38, 59 }, 0 },
-  { { 5|(3<<4) }, { 83, 59 }, 0 },
-  { { 5|(4<<4) }, { 129, 59 }, 0 },
-  { { 5|(5<<4) }, { 144, 59 }, 0 },
-  { { 5|(6<<4) }, { 159, 59 }, 0 },
-  { { 5|(7<<4) }, { 174, 59 }, 0 },
-  { { 10|(4<<4) }, { 193, 59 }, 0 },
-  { { 10|(5<<4) }, { 205, 59 }, 0 },
-  { { 10|(6<<4) }, { 217, 59 }, 0 },
+  { { 5|(0<<4) }, { 8, 59 }, 4 },
+  { { 5|(1<<4) }, { 23, 59 }, 4 },
+  { { 5|(2<<4) }, { 38, 59 }, 4 },
+  { { 5|(3<<4) }, { 83, 59 }, 4 },
+  { { 5|(4<<4) }, { 129, 59 }, 4 },
+  { { 5|(5<<4) }, { 144, 59 }, 4 },
+  { { 5|(6<<4) }, { 159, 59 }, 4 },
+  { { 5|(7<<4) }, { 174, 59 }, 4 },
+  { { 10|(4<<4) }, { 193, 59 }, 4 },
+  { { 10|(5<<4) }, { 205, 59 }, 4 },
+  { { 10|(6<<4) }, { 217, 59 }, 4 },
   // Underglow / Border
-  { { 0xFF }, { 222, 64 }, 0 },
-  { { 0xFF }, { 204, 64 }, 0 },
-  { { 0xFF }, { 186, 64 }, 0 },
-  { { 0xFF }, { 167, 64 }, 0 },
-  { { 0xFF }, { 149, 64 }, 0 },
-  { { 0xFF }, { 130, 64 }, 0 },
-  { { 0xFF }, { 112, 64 }, 0 },
-  { { 0xFF }, { 94, 64 }, 0 },
-  { { 0xFF }, { 75, 64 }, 0 },
-  { { 0xFF }, { 57, 64 }, 0 },
-  { { 0xFF }, { 38, 64 }, 0 },
-  { { 0xFF }, { 20, 64 }, 0 },
-  { { 0xFF }, { 0, 64 }, 0 },
-  { { 0xFF }, { 0, 47 }, 0 },
-  { { 0xFF }, { 0, 32 }, 0 },
-  { { 0xFF }, { 0, 17 }, 0 },
-  { { 0xFF }, { 0, 0 }, 0 },
-  { { 0xFF }, { 20, 0 }, 0 },
-  { { 0xFF }, { 38, 0 }, 0 },
-  { { 0xFF }, { 57, 0 }, 0 },
-  { { 0xFF }, { 75, 0 }, 0 },
-  { { 0xFF }, { 94, 0 }, 0 },
-  { { 0xFF }, { 112, 0 }, 0 },
-  { { 0xFF }, { 130, 0 }, 0 },
-  { { 0xFF }, { 149, 0 }, 0 },
-  { { 0xFF }, { 167, 0 }, 0 },
-  { { 0xFF }, { 186, 0 }, 0 },
-  { { 0xFF }, { 204, 0 }, 0 },
-  { { 0xFF }, { 222, 1 }, 0 },
-  { { 0xFF }, { 224, 17 }, 0 },
-  { { 0xFF }, { 224, 32 }, 0 },
-  { { 0xFF }, { 224, 47 }, 0 },
+  { { 0xFF }, { 222, 64 }, 2 },
+  { { 0xFF }, { 204, 64 }, 2 },
+  { { 0xFF }, { 186, 64 }, 2 },
+  { { 0xFF }, { 167, 64 }, 2 },
+  { { 0xFF }, { 149, 64 }, 2 },
+  { { 0xFF }, { 130, 64 }, 2 },
+  { { 0xFF }, { 112, 64 }, 2 },
+  { { 0xFF }, { 94, 64 }, 2 },
+  { { 0xFF }, { 75, 64 }, 2 },
+  { { 0xFF }, { 57, 64 }, 2 },
+  { { 0xFF }, { 38, 64 }, 2 },
+  { { 0xFF }, { 20, 64 }, 2 },
+  { { 0xFF }, { 0, 64 }, 2 },
+  { { 0xFF }, { 0, 47 }, 2 },
+  { { 0xFF }, { 0, 32 }, 2 },
+  { { 0xFF }, { 0, 17 }, 2 },
+  { { 0xFF }, { 0, 0 }, 2 },
+  { { 0xFF }, { 20, 0 }, 2 },
+  { { 0xFF }, { 38, 0 }, 2 },
+  { { 0xFF }, { 57, 0 }, 2 },
+  { { 0xFF }, { 75, 0 }, 2 },
+  { { 0xFF }, { 94, 0 }, 2 },
+  { { 0xFF }, { 112, 0 }, 2 },
+  { { 0xFF }, { 130, 0 }, 2 },
+  { { 0xFF }, { 149, 0 }, 2 },
+  { { 0xFF }, { 167, 0 }, 2 },
+  { { 0xFF }, { 186, 0 }, 2 },
+  { { 0xFF }, { 204, 0 }, 2 },
+  { { 0xFF }, { 222, 1 }, 2 },
+  { { 0xFF }, { 224, 17 }, 2 },
+  { { 0xFF }, { 224, 32 }, 2 },
+  { { 0xFF }, { 224, 47 }, 2 },
 };
 
 #ifdef USB_LED_INDICATOR_ENABLE
index 182abbbad4fab3068ebd042b9834f110358e9185..53c96d95d0ea4f29daf725ae0ae535b844e8b301 100644 (file)
@@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }
index 41cf82757240a5ea5978cfe1b23fa8378fccee45..79fe7388af6eda597a74aec3d3caf68c1e6166f2 100644 (file)
@@ -98,6 +98,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
                 }
             }
             return false;
+        case RGB_TOG:
+            if (record->event.pressed) {
+              switch (rgb_matrix_get_flags()) {
+                case LED_FLAG_ALL: {
+                    rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_KEYLIGHT: {
+                    rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
+                    rgb_matrix_set_color_all(0, 0, 0);
+                  }
+                  break;
+                case LED_FLAG_UNDERGLOW: {
+                    rgb_matrix_set_flags(LED_FLAG_NONE);
+                    rgb_matrix_disable_noeeprom();
+                  }
+                  break;
+                default: {
+                    rgb_matrix_set_flags(LED_FLAG_ALL);
+                    rgb_matrix_enable_noeeprom();
+                  }
+                  break;
+              }
+            }
+            return false;
         default:
             return true; //Process all other keycodes normally
     }
index 7a62c7424c66bfbda28d0d8804c9ce2c34ae4fe5..0abc1f0da80ee02e5801c22c53385553c1546696 100644 (file)
@@ -46,34 +46,34 @@ void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) {
 #ifdef RGB_MATRIX_ENABLE
 
 __attribute__ ((weak))
-const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
-  {{0x73}, {  3, 35}, 0},
-  {{0x72}, {  0, 26}, 0},
-  {{0x71}, {  0, 17}, 0},
-  {{0x70}, {  0,  6}, 0},
-  {{0x60}, { 14,  5}, 0},
-  {{0x61}, { 15, 16}, 0},
-  {{0x62}, { 16, 25}, 0},
-  {{0x63}, { 17, 34}, 0},
-  {{0x53}, { 31, 29}, 0},
-  {{0x52}, { 31, 19}, 0},
-  {{0x51}, { 30, 11}, 0},
-  {{0x50}, { 30,  1}, 0},
-  {{0x40}, { 45,  0}, 0},
-  {{0x41}, { 45,  8}, 0},
-  {{0x42}, { 46, 17}, 0},
-  {{0x43}, { 46, 27}, 0},
-  {{0x33}, { 60, 27}, 0},
-  {{0x32}, { 60, 18}, 0},
-  {{0x31}, { 60,  9}, 0},
-  {{0x30}, { 60,  0}, 0},
-  {{0x20}, { 74,  2}, 0},
-  {{0x21}, { 74, 11}, 0},
-  {{0x22}, { 75, 20}, 0},
-  {{0x23}, { 74, 28}, 0},
-  {{0x12}, { 89, 30}, 0},
-  {{0x11}, { 89, 19}, 0},
-  {{0x10}, { 89,  7}, 0},
+rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+  {{0x73}, {  3, 35}, 4},
+  {{0x72}, {  0, 26}, 4},
+  {{0x71}, {  0, 17}, 4},
+  {{0x70}, {  0,  6}, 4},
+  {{0x60}, { 14,  5}, 4},
+  {{0x61}, { 15, 16}, 4},
+  {{0x62}, { 16, 25}, 4},
+  {{0x63}, { 17, 34}, 4},
+  {{0x53}, { 31, 29}, 4},
+  {{0x52}, { 31, 19}, 4},
+  {{0x51}, { 30, 11}, 4},
+  {{0x50}, { 30,  1}, 4},
+  {{0x40}, { 45,  0}, 4},
+  {{0x41}, { 45,  8}, 4},
+  {{0x42}, { 46, 17}, 4},
+  {{0x43}, { 46, 27}, 4},
+  {{0x33}, { 60, 27}, 4},
+  {{0x32}, { 60, 18}, 4},
+  {{0x31}, { 60,  9}, 4},
+  {{0x30}, { 60,  0}, 4},
+  {{0x20}, { 74,  2}, 4},
+  {{0x21}, { 74, 11}, 4},
+  {{0x22}, { 75, 20}, 4},
+  {{0x23}, { 74, 28}, 4},
+  {{0x12}, { 89, 30}, 4},
+  {{0x11}, { 89, 19}, 4},
+  {{0x10}, { 89,  7}, 4},
   {{0x00}, { 70, 38}, 1},
   {{0x01}, { 82, 41}, 1},
   {{0x02}, { 93, 45}, 1},
@@ -84,33 +84,33 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
   {{0x76}, {130, 45}, 1},
   {{0x75}, {141, 41}, 1},
   {{0x74}, {153, 38}, 1},
-  {{0x64}, {134,  7}, 0},
-  {{0x65}, {134, 19}, 0},
-  {{0x66}, {134, 30}, 0},
-  {{0x57}, {149, 28}, 0},
-  {{0x56}, {148, 20}, 0},
-  {{0x55}, {149, 11}, 0},
-  {{0x54}, {149,  2}, 0},
-  {{0x44}, {163,  0}, 0},
-  {{0x45}, {163,  9}, 0},
-  {{0x46}, {163, 18}, 0},
-  {{0x47}, {163, 27}, 0},
-  {{0x37}, {177, 27}, 0},
-  {{0x36}, {177, 17}, 0},
-  {{0x35}, {178,  8}, 0},
-  {{0x34}, {178,  0}, 0},
-  {{0x24}, {193,  1}, 0},
-  {{0x25}, {193, 11}, 0},
-  {{0x26}, {192, 19}, 0},
-  {{0x27}, {192, 29}, 0},
-  {{0x17}, {206, 34}, 0},
-  {{0x16}, {207, 25}, 0},
-  {{0x15}, {208, 16}, 0},
-  {{0x14}, {209,  5}, 0},
-  {{0x04}, {224,  6}, 0},
-  {{0x05}, {223, 17}, 0},
-  {{0x06}, {223, 26}, 0},
-  {{0x07}, {220, 35}, 0},
+  {{0x64}, {134,  7}, 4},
+  {{0x65}, {134, 19}, 4},
+  {{0x66}, {134, 30}, 4},
+  {{0x57}, {149, 28}, 4},
+  {{0x56}, {148, 20}, 4},
+  {{0x55}, {149, 11}, 4},
+  {{0x54}, {149,  2}, 4},
+  {{0x44}, {163,  0}, 4},
+  {{0x45}, {163,  9}, 4},
+  {{0x46}, {163, 18}, 4},
+  {{0x47}, {163, 27}, 4},
+  {{0x37}, {177, 27}, 4},
+  {{0x36}, {177, 17}, 4},
+  {{0x35}, {178,  8}, 4},
+  {{0x34}, {178,  0}, 4},
+  {{0x24}, {193,  1}, 4},
+  {{0x25}, {193, 11}, 4},
+  {{0x26}, {192, 19}, 4},
+  {{0x27}, {192, 29}, 4},
+  {{0x17}, {206, 34}, 4},
+  {{0x16}, {207, 25}, 4},
+  {{0x15}, {208, 16}, 4},
+  {{0x14}, {209,  5}, 4},
+  {{0x04}, {224,  6}, 4},
+  {{0x05}, {223, 17}, 4},
+  {{0x06}, {223, 26}, 4},
+  {{0x07}, {220, 35}, 4},
 };
 
 static struct {
index c3b7e26170cb309f039e41014368f40288b3dd9d..94f507189646c51666cd1c6da972b715fcadaf62 100644 (file)
@@ -79,49 +79,49 @@ 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] = {
 
     /*{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}, 0},
-    {{0|(2<<4)},   {20.36*2, 21.33*0}, 0},
-    {{0|(3<<4)},   {20.36*3, 21.33*0}, 0},
-    {{0|(4<<4)},   {20.36*4, 21.33*0}, 0},
-    {{0|(5<<4)},   {20.36*5, 21.33*0}, 0},
-    {{4|(0<<4)},   {20.36*6, 21.33*0}, 0},
-    {{4|(1<<4)},   {20.36*7, 21.33*0}, 0},
-    {{4|(2<<4)},   {20.36*8, 21.33*0}, 0},
-    {{4|(3<<4)},   {20.36*9, 21.33*0}, 0},
-    {{4|(4<<4)},  {20.36*10,21.33*0}, 0},
+    {{0|(1<<4)},   {20.36*1, 21.33*0}, 4},
+    {{0|(2<<4)},   {20.36*2, 21.33*0}, 4},
+    {{0|(3<<4)},   {20.36*3, 21.33*0}, 4},
+    {{0|(4<<4)},   {20.36*4, 21.33*0}, 4},
+    {{0|(5<<4)},   {20.36*5, 21.33*0}, 4},
+    {{4|(0<<4)},   {20.36*6, 21.33*0}, 4},
+    {{4|(1<<4)},   {20.36*7, 21.33*0}, 4},
+    {{4|(2<<4)},   {20.36*8, 21.33*0}, 4},
+    {{4|(3<<4)},   {20.36*9, 21.33*0}, 4},
+    {{4|(4<<4)},  {20.36*10,21.33*0}, 4},
     {{4|(5<<4)},  {20.36*11,21.33*0}, 1},
 
     {{1|(0<<4)},   {20.36*0, 21.33*1}, 1},
-    {{1|(1<<4)},   {20.36*1, 21.33*1}, 0},
-    {{1|(2<<4)},   {20.36*2, 21.33*1}, 0},
-    {{1|(3<<4)},   {20.36*3, 21.33*1}, 0},
-    {{1|(4<<4)},   {20.36*4, 21.33*1}, 0},
-    {{1|(5<<4)},   {20.36*5, 21.33*1}, 0},
-    {{5|(0<<4)},   {20.36*6, 21.33*1}, 0},
-    {{5|(1<<4)},   {20.36*7, 21.33*1}, 0},
-    {{5|(2<<4)},   {20.36*8, 21.33*1}, 0},
-    {{5|(3<<4)},   {20.36*9, 21.33*1}, 0},
-    {{5|(4<<4)},  {20.36*10,21.33*1}, 0},
+    {{1|(1<<4)},   {20.36*1, 21.33*1}, 4},
+    {{1|(2<<4)},   {20.36*2, 21.33*1}, 4},
+    {{1|(3<<4)},   {20.36*3, 21.33*1}, 4},
+    {{1|(4<<4)},   {20.36*4, 21.33*1}, 4},
+    {{1|(5<<4)},   {20.36*5, 21.33*1}, 4},
+    {{5|(0<<4)},   {20.36*6, 21.33*1}, 4},
+    {{5|(1<<4)},   {20.36*7, 21.33*1}, 4},
+    {{5|(2<<4)},   {20.36*8, 21.33*1}, 4},
+    {{5|(3<<4)},   {20.36*9, 21.33*1}, 4},
+    {{5|(4<<4)},  {20.36*10,21.33*1}, 4},
     {{5|(5<<4)},  {20.36*11,21.33*1}, 1},
 
     {{2|(0<<4)},   {20.36*0, 21.33*2}, 1},
-    {{2|(1<<4)},   {20.36*1, 21.33*2}, 0},
-    {{2|(2<<4)},   {20.36*2, 21.33*2}, 0},
-    {{2|(3<<4)},   {20.36*3, 21.33*2}, 0},
-    {{2|(4<<4)},   {20.36*4, 21.33*2}, 0},
-    {{2|(5<<4)},   {20.36*5, 21.33*2}, 0},
-    {{6|(0<<4)},   {20.36*6, 21.33*2}, 0},
-    {{6|(1<<4)},   {20.36*7, 21.33*2}, 0},
-    {{6|(2<<4)},   {20.36*8, 21.33*2}, 0},
-    {{6|(3<<4)},   {20.36*9, 21.33*2}, 0},
-    {{6|(4<<4)},  {20.36*10,21.33*2}, 0},
+    {{2|(1<<4)},   {20.36*1, 21.33*2}, 4},
+    {{2|(2<<4)},   {20.36*2, 21.33*2}, 4},
+    {{2|(3<<4)},   {20.36*3, 21.33*2}, 4},
+    {{2|(4<<4)},   {20.36*4, 21.33*2}, 4},
+    {{2|(5<<4)},   {20.36*5, 21.33*2}, 4},
+    {{6|(0<<4)},   {20.36*6, 21.33*2}, 4},
+    {{6|(1<<4)},   {20.36*7, 21.33*2}, 4},
+    {{6|(2<<4)},   {20.36*8, 21.33*2}, 4},
+    {{6|(3<<4)},   {20.36*9, 21.33*2}, 4},
+    {{6|(4<<4)},  {20.36*10,21.33*2}, 4},
     {{6|(5<<4)},  {20.36*11,21.33*2}, 1},
 
     {{3|(0<<4)},   {20.36*0, 21.33*3}, 1},
@@ -129,7 +129,7 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{3|(2<<4)},   {20.36*2, 21.33*3}, 1},
     {{7|(3<<4)},   {20.36*3, 21.33*3}, 1},
     {{7|(4<<4)},   {20.36*4, 21.33*3}, 1},
-    {{7|(5<<4)},   {20.36*5.5,21.33*3}, 0},
+    {{7|(5<<4)},   {20.36*5.5,21.33*3}, 4},
     {{7|(0<<4)},   {20.36*7, 21.33*3}, 1},
     {{7|(1<<4)},   {20.36*8, 21.33*3}, 1},
     {{7|(2<<4)},   {20.36*9, 21.33*3}, 1},
index 6e3b08938faa14f1f82afa1b01da3ff1e012126d..5b7177c6c992f93e048175f6d3509418ac07bc4d 100644 (file)
@@ -231,7 +231,7 @@ void rgb_matrix_indicators_user(void) {
     case _RAISE:
       for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
         led = g_rgb_leds[i];
-        if ( led.modifier ) {
+        if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
           rgb_matrix_set_color(i, 0x6B, 0x00, 0x80);
         } else {
           rgb_matrix_set_color(i, 0x00, 0xFF, 0x00);
@@ -242,7 +242,7 @@ void rgb_matrix_indicators_user(void) {
     case _LOWER:
       for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
         led = g_rgb_leds[i];
-        if ( led.modifier ) {
+        if (HAS_FLAGS(led.flags, LED_FLAG_MODIFIER)) {
           rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00);
         } else {
           rgb_matrix_set_color(i, 0x00, 0x67, 0xC7);
index f463090dd0b8ee6a0bdf75733ce34acceea4ae63..178d28274c43884112a1c712c84958b0522b5c08 100644 (file)
@@ -77,49 +77,49 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
     {1, C9_14, C8_14, C7_14}
 };
 
-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}, 0},
-    {{0|(2<<4)},   {20.36*2, 21.33*0}, 0},
-    {{0|(3<<4)},   {20.36*3, 21.33*0}, 0},
-    {{0|(4<<4)},   {20.36*4, 21.33*0}, 0},
-    {{0|(5<<4)},   {20.36*5, 21.33*0}, 0},
-    {{0|(6<<4)},   {20.36*6, 21.33*0}, 0},
-    {{0|(7<<4)},   {20.36*7, 21.33*0}, 0},
-    {{0|(8<<4)},   {20.36*8, 21.33*0}, 0},
-    {{0|(9<<4)},   {20.36*9, 21.33*0}, 0},
-    {{0|(10<<4)},  {20.36*10,21.33*0}, 0},
+    {{0|(1<<4)},   {20.36*1, 21.33*0}, 4},
+    {{0|(2<<4)},   {20.36*2, 21.33*0}, 4},
+    {{0|(3<<4)},   {20.36*3, 21.33*0}, 4},
+    {{0|(4<<4)},   {20.36*4, 21.33*0}, 4},
+    {{0|(5<<4)},   {20.36*5, 21.33*0}, 4},
+    {{0|(6<<4)},   {20.36*6, 21.33*0}, 4},
+    {{0|(7<<4)},   {20.36*7, 21.33*0}, 4},
+    {{0|(8<<4)},   {20.36*8, 21.33*0}, 4},
+    {{0|(9<<4)},   {20.36*9, 21.33*0}, 4},
+    {{0|(10<<4)},  {20.36*10,21.33*0}, 4},
     {{0|(11<<4)},  {20.36*11,21.33*0}, 1},
 
     {{1|(0<<4)},   {20.36*0, 21.33*1}, 1},
-    {{1|(1<<4)},   {20.36*1, 21.33*1}, 0},
-    {{1|(2<<4)},   {20.36*2, 21.33*1}, 0},
-    {{1|(3<<4)},   {20.36*3, 21.33*1}, 0},
-    {{1|(4<<4)},   {20.36*4, 21.33*1}, 0},
-    {{1|(5<<4)},   {20.36*5, 21.33*1}, 0},
-    {{1|(6<<4)},   {20.36*6, 21.33*1}, 0},
-    {{1|(7<<4)},   {20.36*7, 21.33*1}, 0},
-    {{1|(8<<4)},   {20.36*8, 21.33*1}, 0},
-    {{1|(9<<4)},   {20.36*9, 21.33*1}, 0},
-    {{1|(10<<4)},  {20.36*10,21.33*1}, 0},
+    {{1|(1<<4)},   {20.36*1, 21.33*1}, 4},
+    {{1|(2<<4)},   {20.36*2, 21.33*1}, 4},
+    {{1|(3<<4)},   {20.36*3, 21.33*1}, 4},
+    {{1|(4<<4)},   {20.36*4, 21.33*1}, 4},
+    {{1|(5<<4)},   {20.36*5, 21.33*1}, 4},
+    {{1|(6<<4)},   {20.36*6, 21.33*1}, 4},
+    {{1|(7<<4)},   {20.36*7, 21.33*1}, 4},
+    {{1|(8<<4)},   {20.36*8, 21.33*1}, 4},
+    {{1|(9<<4)},   {20.36*9, 21.33*1}, 4},
+    {{1|(10<<4)},  {20.36*10,21.33*1}, 4},
     {{1|(11<<4)},  {20.36*11,21.33*1}, 1},
 
     {{2|(0<<4)},   {20.36*0, 21.33*2}, 1},
-    {{2|(1<<4)},   {20.36*1, 21.33*2}, 0},
-    {{2|(2<<4)},   {20.36*2, 21.33*2}, 0},
-    {{2|(3<<4)},   {20.36*3, 21.33*2}, 0},
-    {{2|(4<<4)},   {20.36*4, 21.33*2}, 0},
-    {{2|(5<<4)},   {20.36*5, 21.33*2}, 0},
-    {{2|(6<<4)},   {20.36*6, 21.33*2}, 0},
-    {{2|(7<<4)},   {20.36*7, 21.33*2}, 0},
-    {{2|(8<<4)},   {20.36*8, 21.33*2}, 0},
-    {{2|(9<<4)},   {20.36*9, 21.33*2}, 0},
-    {{2|(10<<4)},  {20.36*10,21.33*2}, 0},
+    {{2|(1<<4)},   {20.36*1, 21.33*2}, 4},
+    {{2|(2<<4)},   {20.36*2, 21.33*2}, 4},
+    {{2|(3<<4)},   {20.36*3, 21.33*2}, 4},
+    {{2|(4<<4)},   {20.36*4, 21.33*2}, 4},
+    {{2|(5<<4)},   {20.36*5, 21.33*2}, 4},
+    {{2|(6<<4)},   {20.36*6, 21.33*2}, 4},
+    {{2|(7<<4)},   {20.36*7, 21.33*2}, 4},
+    {{2|(8<<4)},   {20.36*8, 21.33*2}, 4},
+    {{2|(9<<4)},   {20.36*9, 21.33*2}, 4},
+    {{2|(10<<4)},  {20.36*10,21.33*2}, 4},
     {{2|(11<<4)},  {20.36*11,21.33*2}, 1},
 
     {{3|(0<<4)},   {20.36*0, 21.33*3}, 1},
@@ -127,9 +127,9 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
     {{3|(2<<4)},   {20.36*2, 21.33*3}, 1},
     {{3|(3<<4)},   {20.36*3, 21.33*3}, 1},
     {{3|(4<<4)},   {20.36*4, 21.33*3}, 1},
-    {{3|(5<<4)},   {20.36*5, 21.33*3}, 0},
-    {{3|(5<<4)},   {20.36*5.5,21.33*3}, 0},
-    {{3|(6<<4)},   {20.36*6, 21.33*3}, 0},
+    {{3|(5<<4)},   {20.36*5, 21.33*3}, 4},
+    {{3|(5<<4)},   {20.36*5.5,21.33*3}, 4},
+    {{3|(6<<4)},   {20.36*6, 21.33*3}, 4},
     {{3|(7<<4)},   {20.36*7, 21.33*3}, 1},
     {{3|(8<<4)},   {20.36*8, 21.33*3}, 1},
     {{3|(9<<4)},   {20.36*9, 21.33*3}, 1},
index 049b5c2186943202f031ab23e8f6349f5fe6ffac..b668b02e99492c8bf678d070d875273731c45d63 100644 (file)
@@ -1,35 +1,35 @@
 #include "sol.h"
 
 #ifdef RGB_MATRIX_ENABLE
-  const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+  rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
        // Left Hand Mapped Left to Right
     { {  0 | (0 << 4) }, {   0,  0 }, 1},
-    { {  0 | (1 << 4) }, {  22,  0 }, 0},
-    { {  0 | (2 << 4) }, {  37,  0 }, 0},
-    { {  0 | (3 << 4) }, {  37,  0 }, 0},
-    { {  0 | (4 << 4) }, {  67,  0 }, 0},
-    { {  0 | (5 << 4) }, {  82,  0 }, 0},
+    { {  0 | (1 << 4) }, {  22,  0 }, 4},
+    { {  0 | (2 << 4) }, {  37,  0 }, 4},
+    { {  0 | (3 << 4) }, {  37,  0 }, 4},
+    { {  0 | (4 << 4) }, {  67,  0 }, 4},
+    { {  0 | (5 << 4) }, {  82,  0 }, 4},
     { {  0 | (6 << 4) }, { 104,  0 }, 1},
     { {  1 | (0 << 4) }, {   0, 16 }, 1},
-    { {  1 | (1 << 4) }, {  22, 16 }, 0},
-    { {  1 | (2 << 4) }, {  37, 16 }, 0},
-    { {  1 | (3 << 4) }, {  37, 16 }, 0},
-    { {  1 | (4 << 4) }, {  67, 16 }, 0},
-    { {  1 | (5 << 4) }, {  82, 16 }, 0},
+    { {  1 | (1 << 4) }, {  22, 16 }, 4},
+    { {  1 | (2 << 4) }, {  37, 16 }, 4},
+    { {  1 | (3 << 4) }, {  37, 16 }, 4},
+    { {  1 | (4 << 4) }, {  67, 16 }, 4},
+    { {  1 | (5 << 4) }, {  82, 16 }, 4},
     { {  1 | (6 << 4) }, { 104, 16 }, 1},
     { {  2 | (0 << 4) }, {   0, 32 }, 1},
-    { {  2 | (1 << 4) }, {  22, 32 }, 0},
-    { {  2 | (2 << 4) }, {  37, 32 }, 0},
-    { {  2 | (3 << 4) }, {  37, 32 }, 0},
-    { {  2 | (4 << 4) }, {  67, 32 }, 0},
-    { {  2 | (5 << 4) }, {  82, 32 }, 0},
+    { {  2 | (1 << 4) }, {  22, 32 }, 4},
+    { {  2 | (2 << 4) }, {  37, 32 }, 4},
+    { {  2 | (3 << 4) }, {  37, 32 }, 4},
+    { {  2 | (4 << 4) }, {  67, 32 }, 4},
+    { {  2 | (5 << 4) }, {  82, 32 }, 4},
     { {  2 | (6 << 4) }, { 104, 32 }, 1},
     { {  3 | (0 << 4) }, {   0, 48 }, 1},
-    { {  3 | (1 << 4) }, {  22, 48 }, 0},
-    { {  3 | (2 << 4) }, {  37, 48 }, 0},
-    { {  3 | (3 << 4) }, {  37, 48 }, 0},
-    { {  3 | (4 << 4) }, {  67, 48 }, 0},
-    { {  3 | (5 << 4) }, {  82, 48 }, 0},
+    { {  3 | (1 << 4) }, {  22, 48 }, 4},
+    { {  3 | (2 << 4) }, {  37, 48 }, 4},
+    { {  3 | (3 << 4) }, {  37, 48 }, 4},
+    { {  3 | (4 << 4) }, {  67, 48 }, 4},
+    { {  3 | (5 << 4) }, {  82, 48 }, 4},
     { {  3 | (6 << 4) }, { 104, 48 }, 1},
     { {  4 | (0 << 4) }, {   0, 64 }, 1},
     { {  4 | (1 << 4) }, {  22, 64 }, 1},
     { {  5 | (6 << 4) }, {  97, 55 }, 1},
        // Left Hand Mapped Right to Left
     { {  6 | (0 << 4) }, { 224,  0 }, 1},
-    { {  6 | (1 << 4) }, { 202,  0 }, 0},
-    { {  6 | (2 << 4) }, { 187,  0 }, 0},
-    { {  6 | (3 << 4) }, { 172,  0 }, 0},
-    { {  6 | (4 << 4) }, { 157,  0 }, 0},
-    { {  6 | (5 << 4) }, { 142,  0 }, 0},
+    { {  6 | (1 << 4) }, { 202,  0 }, 4},
+    { {  6 | (2 << 4) }, { 187,  0 }, 4},
+    { {  6 | (3 << 4) }, { 172,  0 }, 4},
+    { {  6 | (4 << 4) }, { 157,  0 }, 4},
+    { {  6 | (5 << 4) }, { 142,  0 }, 4},
     { {  6 | (6 << 4) }, { 120,  0 }, 1},
     { {  7 | (0 << 4) }, { 224, 16 }, 1},
-    { {  7 | (1 << 4) }, { 202, 16 }, 0},
-    { {  7 | (2 << 4) }, { 187, 16 }, 0},
-    { {  7 | (3 << 4) }, { 172, 16 }, 0},
-    { {  7 | (4 << 4) }, { 157, 16 }, 0},
-    { {  7 | (5 << 4) }, { 142, 16 }, 0},
+    { {  7 | (1 << 4) }, { 202, 16 }, 4},
+    { {  7 | (2 << 4) }, { 187, 16 }, 4},
+    { {  7 | (3 << 4) }, { 172, 16 }, 4},
+    { {  7 | (4 << 4) }, { 157, 16 }, 4},
+    { {  7 | (5 << 4) }, { 142, 16 }, 4},
     { {  7 | (6 << 4) }, { 120, 16 }, 1},
     { {  8 | (0 << 4) }, { 224, 32 }, 1},
-    { {  8 | (1 << 4) }, { 202, 32 }, 0},
-    { {  8 | (2 << 4) }, { 187, 32 }, 0},
-    { {  8 | (3 << 4) }, { 172, 32 }, 0},
-    { {  8 | (4 << 4) }, { 157, 32 }, 0},
-    { {  8 | (5 << 4) }, { 142, 32 }, 0},
+    { {  8 | (1 << 4) }, { 202, 32 }, 4},
+    { {  8 | (2 << 4) }, { 187, 32 }, 4},
+    { {  8 | (3 << 4) }, { 172, 32 }, 4},
+    { {  8 | (4 << 4) }, { 157, 32 }, 4},
+    { {  8 | (5 << 4) }, { 142, 32 }, 4},
     { {  8 | (6 << 4) }, { 120, 32 }, 1},
     { {  9 | (0 << 4) }, { 224, 48 }, 1},
-    { {  9 | (1 << 4) }, { 202, 48 }, 0},
-    { {  9 | (2 << 4) }, { 187, 48 }, 0},
-    { {  9 | (3 << 4) }, { 172, 48 }, 0},
-    { {  9 | (4 << 4) }, { 157, 48 }, 0},
-    { {  9 | (5 << 4) }, { 142, 48 }, 0},
+    { {  9 | (1 << 4) }, { 202, 48 }, 4},
+    { {  9 | (2 << 4) }, { 187, 48 }, 4},
+    { {  9 | (3 << 4) }, { 172, 48 }, 4},
+    { {  9 | (4 << 4) }, { 157, 48 }, 4},
+    { {  9 | (5 << 4) }, { 142, 48 }, 4},
     { {  9 | (6 << 4) }, { 120, 48 }, 1},
     { { 10 | (0 << 4) }, { 224, 64 }, 1},
     { { 10 | (1 << 4) }, { 202, 64 }, 1},
index e7f43ad6696717767d867fcb3df673f30ff8781d..26c2e33040cd4fad8fa4fd91b0ae3c357d36c62d 100644 (file)
@@ -405,10 +405,8 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) {
   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 );
     }
   }
 }
index 16defede9671cdbe1fcb0d3556526cfa2954efc9..f82b4e7da7a5a74fcfd738ebc7fe022e4b0b863c 100644 (file)
@@ -179,10 +179,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 );
     }
   }
 }
index 5ca9b87a6370adafdd5d1a6d75fc762a558c42d3..8c16c7790ea89d48c93d6f9f05f293bff3f7ed95 100644 (file)
@@ -162,28 +162,11 @@ void rgb_matrix_update_pwm_buffers(void) {
 }
 
 void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) {
-#ifdef RGB_MATRIX_EXTRA_TOG
-  const bool is_key = g_rgb_leds[index].matrix_co.raw != 0xff;
-  if (
-    (rgb_matrix_config.enable == RGB_ZONE_KEYS && !is_key) ||
-    (rgb_matrix_config.enable == RGB_ZONE_UNDER && is_key)
-  ) {
-    rgb_matrix_driver.set_color(index, 0, 0, 0);
-    return;
-  }
-#endif
-
   rgb_matrix_driver.set_color(index, red, green, blue);
 }
 
 void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) {
-#ifdef RGB_MATRIX_EXTRA_TOG
-  for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
-      rgb_matrix_set_color(i, red, green, blue);
-  }
-#else
   rgb_matrix_driver.set_color_all(red, green, blue);
-#endif
 }
 
 bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
@@ -262,7 +245,7 @@ static bool rgb_matrix_none(effect_params_t* params) {
 
 static uint8_t rgb_last_enable = UINT8_MAX;
 static uint8_t rgb_last_effect = UINT8_MAX;
-static effect_params_t rgb_effect_params = { 0, 0 };
+static effect_params_t rgb_effect_params = { 0, 0xFF };
 static rgb_task_states rgb_task_state = SYNCING;
 
 static void rgb_task_timers(void) {
@@ -575,29 +558,31 @@ void rgb_matrix_set_suspend_state(bool state) {
 }
 
 void rgb_matrix_toggle(void) {
-  rgb_matrix_config.enable++;
-  if (!rgb_matrix_config.enable) {
-    rgb_task_state = STARTING;
-  }
+  rgb_matrix_config.enable ^= 1;
+  rgb_task_state = STARTING;
   eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
 }
 
 void rgb_matrix_enable(void) {
-       rgb_matrix_config.enable = 1;
+  rgb_matrix_enable_noeeprom();
   eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
 }
 
 void rgb_matrix_enable_noeeprom(void) {
-       rgb_matrix_config.enable = 1;
+  if (!rgb_matrix_config.enable)
+    rgb_task_state = STARTING;
+  rgb_matrix_config.enable = 1;
 }
 
 void rgb_matrix_disable(void) {
-       rgb_matrix_config.enable = 0;
+  rgb_matrix_disable_noeeprom();
   eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
 }
 
 void rgb_matrix_disable_noeeprom(void) {
-       rgb_matrix_config.enable = 0;
+  if (rgb_matrix_config.enable)
+    rgb_task_state = STARTING;
+  rgb_matrix_config.enable = 0;
 }
 
 void rgb_matrix_step(void) {
@@ -658,6 +643,14 @@ void rgb_matrix_decrease_speed(void) {
   eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this
 }
 
+led_flags_t rgb_matrix_get_flags(void) {
+  return rgb_effect_params.flags;
+}
+
+void rgb_matrix_set_flags(led_flags_t flags) {
+  rgb_effect_params.flags = flags;
+}
+
 void rgb_matrix_mode(uint8_t mode) {
   rgb_matrix_config.mode = mode;
   rgb_task_state = STARTING;
index 775cbeac0340ec9ef2cbeafcbd93e8aa6141d68d..33665ffff2a4af1989f0b9cf96c51097e58541ab 100644 (file)
@@ -54,7 +54,9 @@
   uint8_t max = DRIVER_LED_TOTAL;
 #endif
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+#define RGB_MATRIX_TEST_LED_FLAGS() if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) continue
+
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 
 typedef struct
 {
@@ -209,6 +211,8 @@ void rgb_matrix_increase_val(void);
 void rgb_matrix_decrease_val(void);
 void rgb_matrix_increase_speed(void);
 void rgb_matrix_decrease_speed(void);
+led_flags_t rgb_matrix_get_flags(void);
+void rgb_matrix_set_flags(led_flags_t flags);
 void rgb_matrix_mode(uint8_t mode);
 void rgb_matrix_mode_noeeprom(uint8_t mode);
 uint8_t rgb_matrix_get_mode(void);
index cc1914d7f4f637d57b1255ee733cfc3dcaeb8bf6..4bd01c4fc835d63cc548857090cdb6e393fa0761 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 // alphas = color1, mods = color2
@@ -14,7 +14,8 @@ bool rgb_matrix_alphas_mods(effect_params_t* params) {
   RGB rgb2 = hsv_to_rgb(hsv);
 
   for (uint8_t i = led_min; i < led_max; i++) {
-    if (g_rgb_leds[i].modifier) {
+    RGB_MATRIX_TEST_LED_FLAGS();
+    if (HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_MODIFIER)) {
       rgb_matrix_set_color(i, rgb2.r, rgb2.g, rgb2.b);
     } else {
       rgb_matrix_set_color(i, rgb1.r, rgb1.g, rgb1.b);
index 4a9a1dcdb244775e3fe8eef97329c0b917de37df..54d60f927d6e5b622fb155018a139211a9c65fc1 100644 (file)
@@ -12,6 +12,7 @@ bool rgb_matrix_breathing(effect_params_t* params) {
   HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, val };
   RGB rgb = hsv_to_rgb(hsv);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
   }
   return led_max < DRIVER_LED_TOTAL;
index 5c18cfa0c912d6ffc8ce31bec86a8586e501f5bf..513dff128126fce1463a09a34a0472e4e71390c3 100644 (file)
@@ -2,16 +2,16 @@
 #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_cycle_all(effect_params_t* params) {
   RGB_MATRIX_USE_LIMITS(led_min, led_max);
 
   HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
-  uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
+  hsv.h = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
   for (uint8_t i = led_min; i < led_max; i++) {
-    hsv.h = time;
+    RGB_MATRIX_TEST_LED_FLAGS();
     RGB rgb = hsv_to_rgb(hsv);
     rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
   }
index f519aeb476fad10a8f9a320208482872d2535f00..428adea22356b7c42fd813c198f692cd5748b29f 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_cycle_left_right(effect_params_t* params) {
@@ -11,6 +11,7 @@ bool rgb_matrix_cycle_left_right(effect_params_t* params) {
   HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
   uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = point.x - time;
     RGB rgb = hsv_to_rgb(hsv);
index 8b91d890de3f3dab67ba3c058fe76cfbdb449e39..ea63095d2e342eb886b901e143849e5828162a4a 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_cycle_up_down(effect_params_t* params) {
@@ -11,6 +11,7 @@ bool rgb_matrix_cycle_up_down(effect_params_t* params) {
   HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
   uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = point.y - time;
     RGB rgb = hsv_to_rgb(hsv);
index dda3157809405da407f0b2ac0c015e6db2af5b7c..00f6e5088010594b51b06d0490a9132336ba8642 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_dual_beacon(effect_params_t* params) {
@@ -13,6 +13,7 @@ bool rgb_matrix_dual_beacon(effect_params_t* params) {
   int8_t cos_value = cos8(time) - 128;
   int8_t sin_value = sin8(time) - 128;
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue;
     RGB rgb = hsv_to_rgb(hsv);
index 11498e22f5c333b360758c314cf43be039bbdc77..05117540aebe518858687f79cc7bb47835709046 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_gradient_up_down(effect_params_t* params) {
@@ -10,6 +10,7 @@ bool rgb_matrix_gradient_up_down(effect_params_t* params) {
   HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
   uint8_t scale = scale8(64, rgb_matrix_config.speed);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     // The y range will be 0..64, map this to 0..4
     // Relies on hue being 8-bit and wrapping
index 01ff5c2306055f333bae0d5ec3e991c4eb55ae1d..dffa532643383fa24d53d01c1195bcb3f1775203 100644 (file)
@@ -2,10 +2,11 @@
 #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
-static void jellybean_raindrops_set_color(int i) {
+static void jellybean_raindrops_set_color(int i, effect_params_t* params) {
+  if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return;
   HSV hsv = { rand() & 0xFF , rand() & 0xFF, rgb_matrix_config.val };
   RGB rgb = hsv_to_rgb(hsv);
   rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
@@ -15,14 +16,14 @@ bool rgb_matrix_jellybean_raindrops(effect_params_t* params) {
   if (!params->init) {
     // Change one LED every tick, make sure speed is not 0
     if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 5 == 0) {
-      jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL);
+      jellybean_raindrops_set_color(rand() % DRIVER_LED_TOTAL, params);
     }
     return false;
   }
 
   RGB_MATRIX_USE_LIMITS(led_min, led_max);
   for (int i = led_min; i < led_max; i++) {
-    jellybean_raindrops_set_color(i);
+    jellybean_raindrops_set_color(i, params);
   }
   return led_max < DRIVER_LED_TOTAL;
 }
index 3c15e64ab6617d8980518a7cebfc3fc20452a120..89f6965c33d6fda603947fb4f48777fc71ff390e 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_rainbow_beacon(effect_params_t* params) {
@@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_beacon(effect_params_t* params) {
   int16_t cos_value = 2 * (cos8(time) - 128);
   int16_t sin_value = 2 * (sin8(time) - 128);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = ((point.y - 32) * cos_value + (point.x - 112) * sin_value) / 128 + rgb_matrix_config.hue;
     RGB rgb = hsv_to_rgb(hsv);
index 0d11d52802be2fa890730673178a9ca7e6072536..0d57aef57bd25eac0adba0c3364ee3444f8d0a30 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) {
@@ -11,6 +11,7 @@ bool rgb_matrix_rainbow_moving_chevron(effect_params_t* params) {
   HSV hsv = { 0, rgb_matrix_config.sat, rgb_matrix_config.val };
   uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = abs8(point.y - 32) + (point.x - time) + rgb_matrix_config.hue;
     RGB rgb = hsv_to_rgb(hsv);
index d7cd42cbe849205d774cf1157002eb3daaf3d68b..03652758c650345d9812f0a6bd63662fba2ae2bd 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
 
 extern rgb_counters_t g_rgb_counters;
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 
 bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) {
@@ -13,6 +13,7 @@ bool rgb_matrix_rainbow_pinwheels(effect_params_t* params) {
   int16_t cos_value = 3 * (cos8(time) - 128);
   int16_t sin_value = 3 * (sin8(time) - 128);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     point_t point = g_rgb_leds[i].point;
     hsv.h = ((point.y - 32) * cos_value + (56 - abs8(point.x - 112)) * sin_value) / 128 + rgb_matrix_config.hue;
     RGB rgb = hsv_to_rgb(hsv);
index fc721375b05ff24648612cab6f182a98a37e9f4b..0e3a878642bef2da932bb4c3dca029837ee86260 100644 (file)
@@ -5,7 +5,8 @@
 extern rgb_counters_t g_rgb_counters;
 extern rgb_config_t rgb_matrix_config;
 
-static void raindrops_set_color(int i) {
+static void raindrops_set_color(int i, effect_params_t* params) {
+  if (!HAS_ANY_FLAGS(g_rgb_leds[i].flags, params->flags)) return;
   HSV hsv = { 0 , rgb_matrix_config.sat, rgb_matrix_config.val };
 
   // Take the shortest path between hues
@@ -25,14 +26,14 @@ bool rgb_matrix_raindrops(effect_params_t* params) {
   if (!params->init) {
     // Change one LED every tick, make sure speed is not 0
     if (scale16by8(g_rgb_counters.tick, qadd8(rgb_matrix_config.speed, 16)) % 10 == 0) {
-      raindrops_set_color(rand() % DRIVER_LED_TOTAL);
+      raindrops_set_color(rand() % DRIVER_LED_TOTAL, params);
     }
     return false;
   }
 
   RGB_MATRIX_USE_LIMITS(led_min, led_max);
   for (int i = led_min; i < led_max; i++) {
-    raindrops_set_color(i);
+    raindrops_set_color(i, params);
   }
   return led_max < DRIVER_LED_TOTAL;
 }
index 24a197beb34dd26af43b6b8a5625bb8dc0f5c28b..033c1f93334fa823b96d3835dd15f1fd3185ebe4 100644 (file)
@@ -8,6 +8,7 @@ bool rgb_matrix_solid_color(effect_params_t* params) {
   HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, rgb_matrix_config.val };
   RGB rgb = hsv_to_rgb(hsv);
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
   }
   return led_max < DRIVER_LED_TOTAL;
index 220e542331a5feb9a677f46c6831d6270d263f54..836409dd60be9503d46ca44823ffb5edcb71abb3 100644 (file)
@@ -13,6 +13,7 @@ bool rgb_matrix_solid_reactive(effect_params_t* params) {
   uint16_t max_tick = 65535 / rgb_matrix_config.speed;
   // Relies on hue being 8-bit and wrapping
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     uint16_t tick = max_tick;
     for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) {
       if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) {
index af602cba15aea4798a3c24bcc879b7be7cb0fc16..1dec1886d176d3de0d216aa73b6f0a189ec1b901 100644 (file)
@@ -2,7 +2,7 @@
 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
 #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS)
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 extern last_hit_t g_last_hit_tracker;
 
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multicross_range(uint8_t start, effect_par
     hsv.v = 0;
     point_t point = g_rgb_leds[i].point;
     for (uint8_t j = start; j < count; j++) {
+      RGB_MATRIX_TEST_LED_FLAGS();
       int16_t dx = point.x - g_last_hit_tracker.x[j];
       int16_t dy = point.y - g_last_hit_tracker.y[j];
       uint8_t dist = sqrt16(dx * dx + dy * dy);
index 8b4a139dc9c05374d385f1b6cfed5f2f06ba5ee4..8952a1e2bff71564ebb356098ff3c9cb4472bd3a 100644 (file)
@@ -2,7 +2,7 @@
 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
 #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS)
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 extern last_hit_t g_last_hit_tracker;
 
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multinexus_range(uint8_t start, effect_par
     hsv.v = 0;
     point_t point = g_rgb_leds[i].point;
     for (uint8_t j = start; j < count; j++) {
+      RGB_MATRIX_TEST_LED_FLAGS();
       int16_t dx = point.x - g_last_hit_tracker.x[j];
       int16_t dy = point.y - g_last_hit_tracker.y[j];
       uint8_t dist = sqrt16(dx * dx + dy * dy);
index e84cd6939245b299cfe63e64901bbeb8ba823f7d..d7bdb414ec1e9dc85c72af9b0c847da9b589923e 100644 (file)
@@ -12,6 +12,7 @@ bool rgb_matrix_solid_reactive_simple(effect_params_t* params) {
   // Max tick based on speed scale ensures results from scale16by8 with rgb_matrix_config.speed are no greater than 255
   uint16_t max_tick = 65535 / rgb_matrix_config.speed;
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     uint16_t tick = max_tick;
     for(uint8_t j = 0; j < g_last_hit_tracker.count; j++) {
       if (g_last_hit_tracker.index[j] == i && g_last_hit_tracker.tick[j] < tick) {
index abb01892edb2581bcb8c3ba868cb8a6881042c40..d86cb12844976f92cfd672b1962738aabc812974 100644 (file)
@@ -2,7 +2,7 @@
 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
 #if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE)
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 extern last_hit_t g_last_hit_tracker;
 
@@ -15,6 +15,7 @@ static bool rgb_matrix_solid_reactive_multiwide_range(uint8_t start, effect_para
     hsv.v = 0;
     point_t point = g_rgb_leds[i].point;
     for (uint8_t j = start; j < count; j++) {
+      RGB_MATRIX_TEST_LED_FLAGS();
       int16_t dx = point.x - g_last_hit_tracker.x[j];
       int16_t dy = point.y - g_last_hit_tracker.y[j];
       uint8_t dist = sqrt16(dx * dx + dy * dy);
index 82ac055b88d9177225e3fe4af9672290716d8396..14312f33daeb152780fd1bea882654eb077c26df 100644 (file)
@@ -2,7 +2,7 @@
 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
 #if !defined(DISABLE_RGB_MATRIX_SOLID_SPLASH) || !defined(DISABLE_RGB_MATRIX_SOLID_MULTISPLASH)
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 extern last_hit_t g_last_hit_tracker;
 
@@ -12,6 +12,7 @@ static bool rgb_matrix_solid_multisplash_range(uint8_t start, effect_params_t* p
   HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 };
   uint8_t count = g_last_hit_tracker.count;
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     hsv.v = 0;
     point_t point = g_rgb_leds[i].point;
     for (uint8_t j = start; j < count; j++) {
index 829d30eef51e39df4eae3baad23c860495a3bc89..3c96d451e1a78a6288b3dc2ff33df792d1bb93e5 100644 (file)
@@ -2,7 +2,7 @@
 #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
 #if !defined(DISABLE_RGB_MATRIX_SPLASH) || !defined(DISABLE_RGB_MATRIX_MULTISPLASH)
 
-extern const rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
+extern rgb_led g_rgb_leds[DRIVER_LED_TOTAL];
 extern rgb_config_t rgb_matrix_config;
 extern last_hit_t g_last_hit_tracker;
 
@@ -12,6 +12,7 @@ static bool rgb_matrix_multisplash_range(uint8_t start, effect_params_t* params)
   HSV hsv = { 0, rgb_matrix_config.sat, 0 };
   uint8_t count = g_last_hit_tracker.count;
   for (uint8_t i = led_min; i < led_max; i++) {
+    RGB_MATRIX_TEST_LED_FLAGS();
     hsv.h = rgb_matrix_config.hue;
     hsv.v = 0;
     point_t point = g_rgb_leds[i].point;
index 908e96da56d2d9824e1afe34c3b5a1921ffb5dec..7a3bc6714f5b79fd9bcdf1965c6ce9ba7bb5dcad 100644 (file)
@@ -67,19 +67,21 @@ typedef union {
   };
 } matrix_co_t;
 
+#define HAS_FLAGS(bits, flags) ((bits & flags) == flags)
+#define HAS_ANY_FLAGS(bits, flags) ((bits & flags) != 0x00)
+
+#define LED_FLAG_ALL 0xFF
+#define LED_FLAG_NONE 0x00
+#define LED_FLAG_MODIFIER 0x01
+#define LED_FLAG_UNDERGLOW 0x02
+#define LED_FLAG_KEYLIGHT 0x04
+
 typedef struct PACKED {
-       matrix_co_t matrix_co;
-       point_t point;
-       uint8_t modifier:1;
+  matrix_co_t matrix_co;
+  point_t point;
+  uint8_t flags;
 } rgb_led;
 
-typedef enum {
-  RGB_ZONE_OFF = 0,
-  RGB_ZONE_ALL,
-  RGB_ZONE_KEYS,
-  RGB_ZONE_UNDER,
-} rgb_zone_t;
-
 typedef union {
   uint32_t raw;
   struct PACKED {
index e29fb6587c9ffb5f71d41b6803658f15f444987e..a2eab1b563ee6f07c1b705f60432aaf45e9ae701 100644 (file)
@@ -443,9 +443,9 @@ static void led_matrix_massdrop_config_override(int i)
 
     uint8_t highest_active_layer = biton32(layer_state);
 
-    if (led_lighting_mode == LED_MODE_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw == 0xff) {
+    if (led_lighting_mode == LED_MODE_KEYS_ONLY && HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) {
         //Do not act on this LED
-    } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && g_rgb_leds[i].matrix_co.raw != 0xff) {
+    } else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && !HAS_FLAGS(g_rgb_leds[i].flags, LED_FLAG_UNDERGLOW)) {
         //Do not act on this LED
     } else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) {
         //Do not act on this LED (Only show indicators)