summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXScorpion2 <rcalt2vt@gmail.com>2019-05-07 18:22:46 -0500
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-05-07 16:22:46 -0700
commitaf89752bffbaf5dcea30ea16be66b4d682701bc4 (patch)
treec82f2bc25409159a44778379db8b3a35afc47b8a
parentc7f8548d9af2045996294602d2a4bd9a214ae23c (diff)
rgb_led struct conversion (aka: Per led (key) type rgb matrix effects - part 2) (#5783)
* Initial conversion of the rgb_led struct * Converting last keyboard & updating effects to take advantage of the new structure * New struct should not be const * Updated docs * Changing define ___ for no led to NO_LED * Missed converting some keymap usages of the old struct layout
-rw-r--r--docs/feature_rgb_matrix.md32
-rw-r--r--keyboards/boston_meetup/2019/2019.c40
-rw-r--r--keyboards/crkbd/rev1/rev1.c125
-rw-r--r--keyboards/doro67/rgb/rgb.c103
-rw-r--r--keyboards/dztech/dz40rgb/dz40rgb.c163
-rw-r--r--keyboards/dztech/dz40rgb/keymaps/default/keymap.c6
-rw-r--r--keyboards/dztech/dz40rgb/keymaps/split_space/keymap.c6
-rw-r--r--keyboards/dztech/dz60rgb/dz60rgb.c419
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/ansi/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/hhkb/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/hhkb_iso/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/iso/keymap.c5
-rw-r--r--keyboards/dztech/dz60rgb/keymaps/mekanist/keymap.c30
-rw-r--r--keyboards/dztech/dz65rgb/dz65rgb.c90
-rw-r--r--keyboards/ergodox_ez/ergodox_ez.c99
-rw-r--r--keyboards/exclusive/e6_rgb/e6_rgb.c130
-rw-r--r--keyboards/hadron/ver3/ver3.c45
-rw-r--r--keyboards/hs60/v1/v1.c218
-rw-r--r--keyboards/massdrop/alt/config_led.c143
-rw-r--r--keyboards/massdrop/ctrl/config_led.c180
-rw-r--r--keyboards/model01/leds.c95
-rw-r--r--keyboards/planck/ez/ez.c78
-rw-r--r--keyboards/planck/keymaps/tom/keymap.c11
-rw-r--r--keyboards/planck/light/light.c87
-rw-r--r--keyboards/sol/rev1/rev1.c115
-rw-r--r--keyboards/sol/sol.c19
-rw-r--r--layouts/community/ergodox/drashna/keymap.c7
-rw-r--r--layouts/community/ortho_4x12/drashna/keymap.c5
-rw-r--r--quantum/rgb_matrix.c16
-rw-r--r--quantum/rgb_matrix.h4
-rw-r--r--quantum/rgb_matrix_animations/alpha_mods_anim.h4
-rw-r--r--quantum/rgb_matrix_animations/cycle_all_anim.h2
-rw-r--r--quantum/rgb_matrix_animations/cycle_left_right_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/cycle_up_down_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/dual_beacon_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/gradient_up_down_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/jellybean_raindrops_anim.h4
-rw-r--r--quantum/rgb_matrix_animations/rainbow_beacon_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/rainbow_moving_chevron_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/rainbow_pinwheels_anim.h5
-rw-r--r--quantum/rgb_matrix_animations/raindrops_anim.h3
-rw-r--r--quantum/rgb_matrix_animations/solid_color_anim.h1
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_anim.h1
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_cross.h7
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_nexus.h7
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_simple_anim.h1
-rw-r--r--quantum/rgb_matrix_animations/solid_reactive_wide.h7
-rw-r--r--quantum/rgb_matrix_animations/solid_splash_anim.h7
-rw-r--r--quantum/rgb_matrix_animations/splash_anim.h7
-rw-r--r--quantum/rgb_matrix_types.h18
-rw-r--r--tmk_core/protocol/arm_atsam/led_matrix.c9
51 files changed, 755 insertions, 1644 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md
index 91ec77ace0..5eb9d5536e 100644
--- a/docs/feature_rgb_matrix.md
+++ b/docs/feature_rgb_matrix.md
@@ -124,21 +124,25 @@ 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:
+From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
```C
-rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
-/* {row | col << 4}
- * | {x=0..224, y=0..64}
- * | | flags
- * | | | */
- {{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
- {{0|(1<<4)}, {20.36*1, 21.33*0}, 4},
- ....
-}
+const led_config_t g_led_config = { {
+ // Key Matrix to LED Index
+ { 5, NO_LED, NO_LED, 0 },
+ { NO_LED, NO_LED, NO_LED, NO_LED },
+ { 4, NO_LED, NO_LED, 1 },
+ { 3, NO_LED, NO_LED, 2 }
+}, {
+ // LED Index to Physical Position
+ { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
+}, {
+ // LED Index to Flag
+ 1, 4, 4, 4, 4, 1
+} };
```
-The first part, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position:
+The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical position on the keyboard. The first value, `x`, is between 0-224 (inclusive), and the second value, `y`, is between 0-64 (inclusive). This range is due to effect that calculate the center or halves for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position:
```C
x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
@@ -147,7 +151,7 @@ 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.
-`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.
+`// LED Index to Flag` 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
@@ -155,8 +159,8 @@ Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based
|------------------------------------|-------------------------------------------|
|`#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_NONE 0x00` |If this LED has no flags. |
+|`#define LED_FLAG_ALL 0xFF` |If this 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. |
diff --git a/keyboards/boston_meetup/2019/2019.c b/keyboards/boston_meetup/2019/2019.c
index 45c1855491..933c14dee4 100644
--- a/keyboards/boston_meetup/2019/2019.c
+++ b/keyboards/boston_meetup/2019/2019.c
@@ -19,20 +19,18 @@
#include "haptic.h"
#ifdef RGB_MATRIX_ENABLE
-#include "rgblight.h"
-
-rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
- /*{row | col << 4}
- | {x=0..224, y=0..64}
- | | modifier
- | | | */
- {{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}
-};
+#include "rgb_matrix.h"
+
+led_config_t g_led_config = { {
+ { 5, NO_LED, NO_LED, 0 },
+ { NO_LED, NO_LED, NO_LED, NO_LED },
+ { 4, NO_LED, NO_LED, 1 },
+ { 3, NO_LED, NO_LED, 2 }
+}, {
+ { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
+}, {
+ 4, 4, 4, 4, 4, 4
+} };
#endif
uint8_t *o_fb;
@@ -48,12 +46,12 @@ uint16_t counterst = 0;
#define ScreenOffInterval 60000 /* milliseconds */
static uint16_t last_flush;
-volatile uint8_t led_numlock = false;
-volatile uint8_t led_capslock = false;
+volatile uint8_t led_numlock = false;
+volatile uint8_t led_capslock = false;
volatile uint8_t led_scrolllock = false;
static uint8_t layer;
-static bool queue_for_send = false;
+static bool queue_for_send = false;
static uint8_t encoder_value = 32;
__attribute__ ((weak))
@@ -64,13 +62,13 @@ void draw_ui(void) {
/* Boston MK title is 55 x 10 pixels */
#define NAME_X 0
-#define NAME_Y 0
+#define NAME_Y 0
draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0);
/* Layer indicator is 41 x 10 pixels */
#define LAYER_INDICATOR_X 60
-#define LAYER_INDICATOR_Y 0
+#define LAYER_INDICATOR_Y 0
draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0);
draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM);
@@ -88,7 +86,7 @@ void draw_ui(void) {
draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM);
}
- }
+ }
draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM);
/* hadron oled location on thumbnail */
draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM);
@@ -195,7 +193,7 @@ void matrix_init_kb(void) {
queue_for_send = true;
matrix_init_user();
}
-
+
void matrix_scan_kb(void) {
if (queue_for_send) {
#ifdef QWIIC_MICRO_OLED_ENABLE
diff --git a/keyboards/crkbd/rev1/rev1.c b/keyboards/crkbd/rev1/rev1.c
index 2345028d2c..38ab927881 100644
--- a/keyboards/crkbd/rev1/rev1.c
+++ b/keyboards/crkbd/rev1/rev1.c
@@ -51,78 +51,65 @@ void led_set_kb(uint8_t usb_led) {
// 05 06 06 05
// 15 14 07 07 14 15 3
-/* {row | col << 4} logical layout rows/cols
- * | {x=0..224, y=0..64} physical layout
- * | | | modifier
- * | | | */
-#define RGB_MATRIX_LEFT_LEDS \
- { { 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 }, 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 }, 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 }, 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 }, 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 }, 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
-rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
- RGB_MATRIX_RIGHT_LEDS
- RGB_MATRIX_LEFT_LEDS
- };
+led_config_t g_led_config = { {
+ { 51, 50, 45, 44, 37, 36, NO_LED },
+ { 52, 49, 46, 43, 38, 35, NO_LED },
+ { 53, 48, 47, 42, 39, 34, NO_LED },
+ { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED },
+ { 24, 23, 18, 17, 10, 9, NO_LED },
+ { 25, 22, 19, 16, 11, 8, NO_LED },
+ { 26, 21, 20, 15, 12, 7, NO_LED },
+ { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED }
+}, {
+ { 139, 16 }, { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 },
+ { 139, 39 }, { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 },
+ { 164, 55 }, { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 },
+ { 208, 42 }, { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 }, { 85, 16 },
+ { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 }, { 85, 39 },
+ { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 }, { 60, 55 },
+ { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 }, { 16, 42 },
+ { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 }
+}, {
+ 2, 2, 2, 2, 2, 2, 1,
+ 4, 4, 4, 4, 4, 4, 1,
+ 1, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 1, 1, 1, 2,
+ 2, 2, 2, 2, 2, 1, 4,
+ 4, 4, 4, 4, 4, 1, 1,
+ 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 1, 1, 1
+} };
#else
-rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
- RGB_MATRIX_LEFT_LEDS
- RGB_MATRIX_RIGHT_LEDS
- };
+led_config_t g_led_config = { {
+ { 24, 23, 18, 17, 10, 9, NO_LED },
+ { 25, 22, 19, 16, 11, 8, NO_LED },
+ { 26, 21, 20, 15, 12, 7, NO_LED },
+ { NO_LED, NO_LED, NO_LED, 14, 13, 6, NO_LED },
+ { 51, 50, 45, 44, 37, 36, NO_LED },
+ { 52, 49, 46, 43, 38, 35, NO_LED },
+ { 53, 48, 47, 42, 39, 34, NO_LED },
+ { NO_LED, NO_LED, NO_LED, 41, 40, 33, NO_LED }
+}, {
+ { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, { 95, 63 },
+ { 85, 39 }, { 85, 21 }, { 85, 4 }, { 68, 2 }, { 68, 19 }, { 68, 37 }, { 80, 58 },
+ { 60, 55 }, { 50, 35 }, { 50, 13 }, { 50, 0 }, { 33, 3 }, { 33, 20 }, { 33, 37 },
+ { 16, 42 }, { 16, 24 }, { 16, 7 }, { 0, 7 }, { 0, 24 }, { 0, 41 }, { 139, 16 },
+ { 174, 13 }, { 208, 20 }, { 208, 38 }, { 174, 48 }, { 139, 52 }, { 129, 63 }, { 139, 39 },
+ { 139, 21 }, { 139, 4 }, { 156, 2 }, { 156, 19 }, { 156, 37 }, { 144, 58 }, { 164, 55 },
+ { 174, 35 }, { 174, 13 }, { 174, 0 }, { 191, 3 }, { 191, 20 }, { 191, 37 }, { 208, 42 },
+ { 208, 24 }, { 208, 7 }, { 224, 7 }, { 224, 24 }, { 224, 41 }
+}, {
+ 2, 2, 2, 2, 2, 2, 1,
+ 4, 4, 4, 4, 4, 4, 1,
+ 1, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 1, 1, 1, 2,
+ 2, 2, 2, 2, 2, 1, 4,
+ 4, 4, 4, 4, 4, 1, 1,
+ 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 1, 1, 1
+} };
#endif
#endif
diff --git a/keyboards/doro67/rgb/rgb.c b/keyboards/doro67/rgb/rgb.c
index 8aaf6ef4ad..e8c9ac6321 100644
--- a/keyboards/doro67/rgb/rgb.c
+++ b/keyboards/doro67/rgb/rgb.c
@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "rgb.h"
+#include "rgb_matrix_types.h"
// Optional override functions below.
// You can leave any or all of these undefined.
@@ -52,76 +53,32 @@ void led_set_kb(uint8_t usb_led) {
led_set_user(usb_led);
}
-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}, 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}, 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}, 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}, 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
- {{4|(13<<4)}, {15*14, 64}, 1}, // Down
- {{4|(14<<4)}, {15*15, 64}, 1}, // Right
-};
+led_config_t g_led_config = { {
+ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 },
+ { 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 },
+ { 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, NO_LED, 42, 43 },
+ { 44, NO_LED, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 },
+ { 58, 59, 60, 61, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 62, 63, NO_LED, 64, 65, 66 }
+}, {
+ // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins
+ { 0, 0 }, { 15, 0 }, { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 120, 0 }, { 135, 0 }, { 150, 0 }, { 165, 0 }, { 180, 0 }, { 202, 0 }, { 225, 0 },
+ // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del
+ { 7, 16 }, { 22, 16 }, { 37, 16 }, { 52, 16 }, { 67, 16 }, { 82, 16 }, { 97, 16 }, { 112, 16 }, { 127, 16 }, { 142, 16 }, { 157, 16 }, { 172, 16 }, { 187, 16 }, { 206, 16 }, { 225, 16 },
+ // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup
+ { 11, 32 }, { 26, 32 }, { 41, 32 }, { 56, 32 }, { 71, 32 }, { 86, 32 }, { 101, 32 }, { 116, 32 }, { 131, 32 }, { 146, 32 }, { 161, 32 }, { 176, 32 }, { 198, 32 }, { 225, 32 },
+ // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn
+ { 18, 48 }, { 30, 48 }, { 45, 48 }, { 60, 48 }, { 75, 48 }, { 90, 48 }, { 105, 48 }, { 120, 48 }, { 135, 48 }, { 150, 48 }, { 165, 48 }, { 191, 48 }, { 210, 48 }, { 225, 48 },
+ // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right
+ { 3, 64 }, { 22, 64 }, { 33, 64 }, { 101, 64 }, { 135, 64 }, { 153, 64 }, { 195, 64 }, { 210, 64 }, { 225, 64 }
+}, {
+ // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace, Ins
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
+ // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , Del
+ 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
+ // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter, Pgup
+ 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
+ // LShift, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, Pgdn
+ 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
+ // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right
+ 1, 1, 1, 4, 1, 1, 1, 1, 1
+} };
diff --git a/keyboards/dztech/dz40rgb/dz40rgb.c b/keyboards/dztech/dz40rgb/dz40rgb.c
index 34bfc4366f..e5e39c92ab 100644
--- a/keyboards/dztech/dz40rgb/dz40rgb.c
+++ b/keyboards/dztech/dz40rgb/dz40rgb.c
@@ -52,7 +52,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{0, E_3, D_3, F_3},
{0, E_2, D_2, F_2},
{0, E_1, D_1, F_1},
-
+
{0, E_13, D_13, F_13},
{0, E_14, D_14, F_14},
@@ -71,70 +71,25 @@ const is31_led g_is31_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},
- {{0|(9<<4)}, {20.36*9, 0}, 1},
- {{0|(8<<4)}, {20.36*8, 0}, 1},
- {{0|(7<<4)}, {20.36*7, 0}, 1},
- {{0|(6<<4)}, { 20.36*6, 0}, 1},
- {{0|(5<<4)}, { 20.36*5, 0}, 1},
- {{0|(4<<4)}, { 20.36*4, 0}, 1},
- {{0|(3<<4)}, { 20.36*3, 0}, 1},
- {{0|(2<<4)}, { 20.36*2, 0}, 1},
- {{0|(1<<4)}, { 20.36*1, 0}, 1},
- {{0|(0<<4)}, { 20.36*0, 0}, 1},
-
- {{0|(12<<4)}, {20.36*11, 21.33*0.5}, 1},
- {{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}, 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},
+led_config_t g_led_config = { {
+ { 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 },
+ { 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14 },
+ { 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28 },
+ { 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42 }
+}, {
+ { 223, 0 }, { 203, 0 }, { 183, 0 }, { 162, 0 }, { 142, 0 }, { 122, 0 }, { 101, 0 }, { 81, 0 }, { 61, 0 }, { 40, 0 }, { 20, 0 }, { 0, 0 },
+ { 223, 10 }, { 0, 10 }, { 223, 21 }, { 203, 21 }, { 183, 21 }, { 162, 21 }, { 142, 21 }, { 122, 21 }, { 101, 21 }, { 81, 21 }, { 61, 21 }, { 40, 21 },
+ { 20, 21 }, { 0, 21 }, { 223, 31 }, { 0, 31 }, { 223, 42 }, { 203, 42 }, { 183, 42 }, { 162, 42 }, { 142, 42 }, { 122, 42 }, { 101, 42 }, { 81, 42 },
+ { 61, 42 }, { 40, 42 }, { 20, 42 }, { 0, 42 }, { 223, 53 }, { 0, 53 }, { 223, 63 }, { 203, 63 }, { 183, 63 }, { 162, 63 }, { 142, 63 }, { 122, 63 },
+ { 101, 63 }, { 81, 63 }, { 61, 63 }, { 40, 63 }, { 20, 63 }, { 0, 63 }
+}, {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1
+} };
- {{2|(11<<4)}, {20.36*11, 21.33*2}, 1},
- {{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},
- {{2|(13<<4)}, {20.36*0,21.33*2.5}, 1},
-
- {{3|(11<<4)}, {20.36*11, 21.33*3}, 1},
- {{3|(10<<4)}, {20.36*10, 21.33*3}, 1},
- {{3|(9<<4)}, {20.36*9, 21.33*3}, 1},
- {{3|(8<<4)}, {20.36*8, 21.33*3}, 1},
- {{3|(7<<4)}, {20.36*7, 21.33*3}, 1},
- {{3|(6<<4)}, { 20.36*6, 21.33*3}, 1},
- {{3|(5<<4)}, { 20.36*5, 21.33*3}, 1},
- {{3|(4<<4)}, { 20.36*4, 21.33*3}, 1},
- {{3|(3<<4)}, { 20.36*3, 21.33*3}, 1},
- {{3|(2<<4)}, { 20.36*2, 21.33*3}, 1},
- {{3|(1<<4)}, { 20.36*1, 21.33*3}, 1},
- {{3|(0<<4)}, { 20.36*0, 21.33*3}, 1}
-
-};
#else
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
@@ -205,69 +160,25 @@ const is31_led g_is31_leds[DRI