From 9be6d76c61f5b760e7ceaf03fe80da3f07a29d8a Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 11 Jul 2024 22:50:26 +1000 Subject: [PATCH] `mt/mt64rgb`: move RGB Matrix config to data driven (#24089) --- keyboards/mt/mt64rgb/config.h | 2 - keyboards/mt/mt64rgb/keyboard.json | 70 +++++++++++++++++++ keyboards/mt/mt64rgb/keymaps/default/keymap.c | 3 - keyboards/mt/mt64rgb/keymaps/via/keymap.c | 3 - keyboards/mt/mt64rgb/mt64rgb.c | 20 ------ 5 files changed, 70 insertions(+), 28 deletions(-) diff --git a/keyboards/mt/mt64rgb/config.h b/keyboards/mt/mt64rgb/config.h index f69c778b8b..ad034ceec8 100644 --- a/keyboards/mt/mt64rgb/config.h +++ b/keyboards/mt/mt64rgb/config.h @@ -16,5 +16,3 @@ #pragma once #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND - -#define RGB_MATRIX_LED_COUNT 64 diff --git a/keyboards/mt/mt64rgb/keyboard.json b/keyboards/mt/mt64rgb/keyboard.json index 0858e85eca..451be59f8f 100644 --- a/keyboards/mt/mt64rgb/keyboard.json +++ b/keyboards/mt/mt64rgb/keyboard.json @@ -60,6 +60,76 @@ "solid_multisplash": true }, "driver": "is31fl3733", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 16, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 32, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 48, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 64, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 80, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 96, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 112, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 128, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 144, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 160, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 176, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 192, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 216, "y": 0, "flags": 1}, + + {"matrix": [1, 0], "x": 4, "y": 16, "flags": 1}, + {"matrix": [1, 1], "x": 24, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 40, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 56, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 72, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 88, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 104, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 120, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 136, "y": 16, "flags": 4}, + {"matrix": [1, 9], "x": 152, "y": 16, "flags": 4}, + {"matrix": [1, 10], "x": 168, "y": 16, "flags": 4}, + {"matrix": [1, 11], "x": 184, "y": 16, "flags": 4}, + {"matrix": [1, 12], "x": 200, "y": 16, "flags": 4}, + {"matrix": [1, 13], "x": 220, "y": 16, "flags": 1}, + + {"matrix": [2, 0], "x": 6, "y": 32, "flags": 1}, + {"matrix": [2, 1], "x": 28, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 44, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 60, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 76, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 92, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 108, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 124, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 140, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 156, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 172, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 188, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 214, "y": 32, "flags": 1}, + + {"matrix": [3, 0], "x": 8, "y": 48, "flags": 1}, + {"matrix": [3, 1], "x": 32, "y": 48, "flags": 4}, + {"matrix": [3, 2], "x": 48, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 64, "y": 48, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 96, "y": 48, "flags": 4}, + {"matrix": [3, 6], "x": 112, "y": 48, "flags": 4}, + {"matrix": [3, 7], "x": 128, "y": 48, "flags": 4}, + {"matrix": [3, 8], "x": 144, "y": 48, "flags": 4}, + {"matrix": [3, 9], "x": 160, "y": 48, "flags": 4}, + {"matrix": [3, 10], "x": 176, "y": 48, "flags": 4}, + {"matrix": [3, 11], "x": 192, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 208, "y": 48, "flags": 4}, + {"matrix": [3, 13], "x": 224, "y": 48, "flags": 1}, + + {"matrix": [4, 0], "x": 2, "y": 64, "flags": 1}, + {"matrix": [4, 1], "x": 22, "y": 64, "flags": 1}, + {"matrix": [4, 2], "x": 42, "y": 64, "flags": 1}, + {"matrix": [4, 5], "x": 102, "y": 64, "flags": 4}, + {"matrix": [4, 9], "x": 160, "y": 64, "flags": 1}, + {"matrix": [4, 10], "x": 176, "y": 64, "flags": 1}, + {"matrix": [4, 11], "x": 192, "y": 64, "flags": 4}, + {"matrix": [4, 12], "x": 208, "y": 64, "flags": 4}, + {"matrix": [4, 13], "x": 224, "y": 64, "flags": 4} + ], "led_flush_limit": 26, "led_process_limit": 20, "max_brightness": 160 diff --git a/keyboards/mt/mt64rgb/keymaps/default/keymap.c b/keyboards/mt/mt64rgb/keymaps/default/keymap.c index 7cff3be34c..6c0d1a83fd 100644 --- a/keyboards/mt/mt64rgb/keymaps/default/keymap.c +++ b/keyboards/mt/mt64rgb/keymaps/default/keymap.c @@ -37,9 +37,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool rgb_matrix_indicators_user(void) { - if (layer_state_is(1)) { - rgb_matrix_set_color(77,0xFF, 0x80, 0x00); - } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } diff --git a/keyboards/mt/mt64rgb/keymaps/via/keymap.c b/keyboards/mt/mt64rgb/keymaps/via/keymap.c index df4884a3a3..7340b89ebb 100644 --- a/keyboards/mt/mt64rgb/keymaps/via/keymap.c +++ b/keyboards/mt/mt64rgb/keymaps/via/keymap.c @@ -34,9 +34,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; bool rgb_matrix_indicators_user(void) { - if (layer_state_is(1)) { - rgb_matrix_set_color(77,0xFF, 0x80, 0x00); - } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } diff --git a/keyboards/mt/mt64rgb/mt64rgb.c b/keyboards/mt/mt64rgb/mt64rgb.c index bcf26de231..d08d87de46 100644 --- a/keyboards/mt/mt64rgb/mt64rgb.c +++ b/keyboards/mt/mt64rgb/mt64rgb.c @@ -93,24 +93,4 @@ const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { {0, SW10_CS10, SW11_CS10, SW12_CS10}, {0, SW10_CS15, SW11_CS15, SW12_CS15} }; - -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, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54 }, - { 55, 56, 57, 58, 59, 60, 61, 62, 63} -}, { - { 0, 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, { 64, 0 }, { 80, 0 }, { 96, 0 }, { 112, 0 }, { 128, 0 }, { 144, 0 }, { 160, 0 }, { 176, 0 }, { 192, 0 }, { 216, 0 }, - { 4, 16 }, { 18, 16 }, { 34, 16 }, { 50, 16 }, { 66, 16 }, { 82, 16 }, { 98, 16 }, { 114, 16 }, { 130, 16 }, { 146, 16 }, { 162, 16 }, { 178, 16 }, { 194, 16 }, { 220, 16 }, - { 6, 32 }, { 20, 32 }, { 36, 32 }, { 52, 32 }, { 68, 32 }, { 84, 32 }, { 100, 32 }, { 116, 32 }, { 132, 32 }, { 148, 32 }, { 164, 32 }, { 180, 32 }, { 212, 32 }, - { 9, 48 }, { 27, 48 }, { 43, 48 }, { 59, 48 }, { 75, 48 }, { 91, 48 }, { 107, 48 }, { 123, 48 }, { 139, 48 }, { 155, 48 }, { 171, 48 }, { 187, 48 }, { 203, 48 }, { 219, 48 }, - { 2, 64 }, { 16, 64 }, { 32, 64 }, { 64, 64 }, { 114, 64 }, { 130, 64 }, { 146, 64 }, { 204, 64 }, { 224, 64 } -}, { - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 1, 1, 1, 4, 1, 1, 4, 4, 4, -}}; #endif