From d08da05cb8cff3f03670b1303d418996695834b4 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 8 Jul 2024 15:57:13 +1000 Subject: [PATCH] `mechlovin/olly/octagon`: move LED Matrix LED config to data driven (#24069) --- keyboards/mechlovin/olly/octagon/config.h | 2 - .../mechlovin/olly/octagon/keyboard.json | 105 +++++++++++++++++- keyboards/mechlovin/olly/octagon/octagon.c | 27 ----- 3 files changed, 104 insertions(+), 30 deletions(-) diff --git a/keyboards/mechlovin/olly/octagon/config.h b/keyboards/mechlovin/olly/octagon/config.h index 6f9d5f9a027..791bfee784d 100644 --- a/keyboards/mechlovin/olly/octagon/config.h +++ b/keyboards/mechlovin/olly/octagon/config.h @@ -19,8 +19,6 @@ along with this program. If not, see . #define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_SDA -#define LED_MATRIX_LED_COUNT 94 - #define I2C_DRIVER I2CD2 #define I2C1_SCL_PIN B10 #define I2C1_SDA_PIN B11 diff --git a/keyboards/mechlovin/olly/octagon/keyboard.json b/keyboards/mechlovin/olly/octagon/keyboard.json index 81b78b0b1cb..4bc7d88ed77 100644 --- a/keyboards/mechlovin/olly/octagon/keyboard.json +++ b/keyboards/mechlovin/olly/octagon/keyboard.json @@ -57,7 +57,110 @@ "wave_up_down": true }, "driver": "is31fl3731", - "react_on_keyup": true + "react_on_keyup": true, + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [0, 1], "x": 15, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 30, "y": 0, "flags": 4}, + {"matrix": [0, 3], "x": 45, "y": 0, "flags": 4}, + {"matrix": [0, 4], "x": 60, "y": 0, "flags": 4}, + {"matrix": [0, 5], "x": 75, "y": 0, "flags": 4}, + {"matrix": [0, 6], "x": 90, "y": 0, "flags": 4}, + {"matrix": [0, 7], "x": 105, "y": 0, "flags": 4}, + {"matrix": [0, 8], "x": 120, "y": 0, "flags": 4}, + {"matrix": [0, 9], "x": 134, "y": 0, "flags": 4}, + {"matrix": [0, 10], "x": 149, "y": 0, "flags": 4}, + {"matrix": [0, 11], "x": 164, "y": 0, "flags": 4}, + {"matrix": [0, 12], "x": 179, "y": 0, "flags": 4}, + {"matrix": [0, 13], "x": 194, "y": 0, "flags": 4}, + {"matrix": [0, 14], "x": 209, "y": 0, "flags": 4}, + {"matrix": [0, 15], "x": 224, "y": 0, "flags": 4}, + + {"matrix": [1, 0], "x": 0, "y": 13, "flags": 4}, + {"matrix": [1, 1], "x": 15, "y": 13, "flags": 4}, + {"matrix": [1, 2], "x": 30, "y": 13, "flags": 4}, + {"matrix": [1, 3], "x": 45, "y": 13, "flags": 4}, + {"matrix": [1, 4], "x": 60, "y": 13, "flags": 4}, + {"matrix": [1, 5], "x": 75, "y": 13, "flags": 4}, + {"matrix": [1, 6], "x": 90, "y": 13, "flags": 4}, + {"matrix": [1, 7], "x": 105, "y": 13, "flags": 4}, + {"matrix": [1, 8], "x": 120, "y": 13, "flags": 4}, + {"matrix": [1, 9], "x": 134, "y": 13, "flags": 4}, + {"matrix": [1, 10], "x": 149, "y": 13, "flags": 4}, + {"matrix": [1, 11], "x": 164, "y": 13, "flags": 4}, + {"matrix": [1, 12], "x": 179, "y": 13, "flags": 4}, + {"matrix": [1, 13], "x": 194, "y": 13, "flags": 4}, + {"matrix": [1, 14], "x": 209, "y": 13, "flags": 4}, + {"matrix": [1, 15], "x": 224, "y": 13, "flags": 4}, + + {"matrix": [2, 0], "x": 4, "y": 26, "flags": 4}, + {"matrix": [2, 1], "x": 22, "y": 26, "flags": 4}, + {"matrix": [2, 2], "x": 37, "y": 26, "flags": 4}, + {"matrix": [2, 3], "x": 52, "y": 26, "flags": 4}, + {"matrix": [2, 4], "x": 67, "y": 26, "flags": 4}, + {"matrix": [2, 5], "x": 82, "y": 26, "flags": 4}, + {"matrix": [2, 6], "x": 97, "y": 26, "flags": 4}, + {"matrix": [2, 7], "x": 112, "y": 26, "flags": 4}, + {"matrix": [2, 8], "x": 127, "y": 26, "flags": 4}, + {"matrix": [2, 9], "x": 142, "y": 26, "flags": 4}, + {"matrix": [2, 10], "x": 157, "y": 26, "flags": 4}, + {"matrix": [2, 11], "x": 172, "y": 26, "flags": 4}, + {"matrix": [2, 12], "x": 187, "y": 26, "flags": 4}, + {"matrix": [2, 14], "x": 205, "y": 26, "flags": 4}, + {"matrix": [2, 15], "x": 224, "y": 26, "flags": 4}, + + {"matrix": [3, 0], "x": 6, "y": 38, "flags": 4}, + {"matrix": [3, 1], "x": 26, "y": 38, "flags": 4}, + {"matrix": [3, 2], "x": 41, "y": 38, "flags": 4}, + {"matrix": [3, 3], "x": 56, "y": 38, "flags": 4}, + {"matrix": [3, 4], "x": 71, "y": 38, "flags": 4}, + {"matrix": [3, 5], "x": 86, "y": 38, "flags": 4}, + {"matrix": [3, 6], "x": 101, "y": 38, "flags": 4}, + {"matrix": [3, 7], "x": 116, "y": 38, "flags": 4}, + {"matrix": [3, 8], "x": 131, "y": 38, "flags": 4}, + {"matrix": [3, 9], "x": 146, "y": 38, "flags": 4}, + {"matrix": [3, 10], "x": 161, "y": 38, "flags": 4}, + {"matrix": [3, 11], "x": 175, "y": 38, "flags": 4}, + {"matrix": [3, 12], "x": 190, "y": 38, "flags": 4}, + {"matrix": [3, 13], "x": 207, "y": 38, "flags": 4}, + {"matrix": [3, 15], "x": 224, "y": 38, "flags": 4}, + + {"matrix": [4, 0], "x": 2, "y": 51, "flags": 4}, + {"matrix": [4, 1], "x": 19, "y": 51, "flags": 4}, + {"matrix": [4, 2], "x": 34, "y": 51, "flags": 4}, + {"matrix": [4, 3], "x": 49, "y": 51, "flags": 4}, + {"matrix": [4, 4], "x": 64, "y": 51, "flags": 4}, + {"matrix": [4, 5], "x": 78, "y": 51, "flags": 4}, + {"matrix": [4, 6], "x": 93, "y": 51, "flags": 4}, + {"matrix": [4, 7], "x": 108, "y": 51, "flags": 4}, + {"matrix": [4, 8], "x": 123, "y": 51, "flags": 4}, + {"matrix": [4, 9], "x": 138, "y": 51, "flags": 4}, + {"matrix": [4, 10], "x": 153, "y": 51, "flags": 4}, + {"matrix": [4, 11], "x": 168, "y": 51, "flags": 4}, + {"matrix": [4, 12], "x": 189, "y": 51, "flags": 4}, + {"matrix": [4, 14], "x": 209, "y": 51, "flags": 4}, + {"matrix": [4, 15], "x": 224, "y": 51, "flags": 4}, + + {"matrix": [5, 0], "x": 2, "y": 64, "flags": 4}, + {"matrix": [5, 1], "x": 21, "y": 64, "flags": 4}, + {"matrix": [5, 2], "x": 39, "y": 64, "flags": 4}, + {"matrix": [5, 6], "x": 95, "y": 64, "flags": 4}, + {"matrix": [5, 10], "x": 149, "y": 64, "flags": 4}, + {"matrix": [5, 11], "x": 164, "y": 64, "flags": 4}, + {"matrix": [5, 12], "x": 179, "y": 64, "flags": 4}, + {"matrix": [5, 13], "x": 194, "y": 64, "flags": 4}, + {"matrix": [5, 14], "x": 209, "y": 64, "flags": 4}, + {"matrix": [5, 15], "x": 224, "y": 64, "flags": 4}, + + {"x": 113, "y": 0, "flags": 8}, + {"x": 127, "y": 0, "flags": 8}, + {"x": 142, "y": 0, "flags": 8}, + + {"x": 172, "y": 0, "flags": 8}, + {"x": 187, "y": 0, "flags": 8}, + {"x": 202, "y": 0, "flags": 8}, + {"x": 217, "y": 0, "flags": 8} + ] }, "matrix_pins": { "cols": ["A10", "A9", "A8", "B15", "B14", "B13", "B2", "B1", "A15", "B3", "B9", "B8", "B7", "B6", "B5", "B4"], diff --git a/keyboards/mechlovin/olly/octagon/octagon.c b/keyboards/mechlovin/olly/octagon/octagon.c index c89565168b2..a8ff139c01b 100644 --- a/keyboards/mechlovin/olly/octagon/octagon.c +++ b/keyboards/mechlovin/olly/octagon/octagon.c @@ -31,33 +31,6 @@ const is31fl3731_led_t PROGMEM g_is31fl3731_leds[IS31FL3731_LED_COUNT] = { { 0, C7_13 }, { 0, C7_14 }, { 0, C7_15 }, { 0, C7_16 }, // Layer Indicator }; -led_config_t g_led_config = { -{ - // Key Matrix to LED Index - { 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, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76}, - {77, 78, 79, 80, 81, 82, 83, 84, 85, 86}, -}, { - //LED Index to Physical Positon - {0, 0}, {15, 0}, {30, 0}, {45, 0}, {60, 0}, {75, 0}, {90, 0}, {105, 0}, {119, 0}, {134, 0}, {149, 0}, {164, 0}, {179, 0}, {194, 0}, {209, 0}, {224, 0}, - {0,13}, {15, 13}, {30, 13}, {45, 13}, {60, 13}, {75, 13}, {90, 13}, {105,13}, {119,13}, {134,13}, {149,13}, {164,13}, {179,13}, {194,13}, {209,13}, {224,13}, - {0,26}, {15, 26}, {30, 26}, {45, 26}, {60, 26}, {75, 26}, {90, 26}, {105,26}, {119,26}, {134,26}, {149,26}, {164,26}, {179,26}, {194,26}, {224,26}, - {0,38}, {15, 38}, {30, 38}, {45, 38}, {60, 38}, {75, 38}, {90, 38}, {105,38}, {119,38}, {134,38}, {149,38}, {164,38}, {179,38}, {194,38}, {224,38}, - {0,51}, {15, 51}, {30, 51}, {45, 51}, {60, 51}, {75, 51}, {90, 51}, {105,51}, {119,51}, {134,51}, {149,51}, {164,51}, {179,51}, {194,51}, {224,51}, - {0,64}, {15, 64}, {30, 64}, {90, 64}, {149,64}, {164,64}, {179,64}, {194,64}, {209,64}, {224,64}, - }, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - } -}; - bool led_matrix_indicators_kb(void) { if (!led_matrix_indicators_user()) { return false;