From eb78ca1c1ad781d827acb1f0b65f6ac3475710ee Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 4 Aug 2024 09:37:57 +1000 Subject: [PATCH] `handwired/p65rgb`: move RGB Matrix LED config to data driven (#24124) --- keyboards/handwired/p65rgb/config.h | 20 ----- keyboards/handwired/p65rgb/keyboard.json | 96 +++++++++++++++++++++++- keyboards/handwired/p65rgb/p65rgb.c | 22 +----- 3 files changed, 97 insertions(+), 41 deletions(-) delete mode 100644 keyboards/handwired/p65rgb/config.h diff --git a/keyboards/handwired/p65rgb/config.h b/keyboards/handwired/p65rgb/config.h deleted file mode 100644 index 776088feb0..0000000000 --- a/keyboards/handwired/p65rgb/config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2019 marhalloweenvt - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#pragma once - -#define RGB_MATRIX_LED_COUNT 83 diff --git a/keyboards/handwired/p65rgb/keyboard.json b/keyboards/handwired/p65rgb/keyboard.json index 474e2b8edd..b80a1e7f49 100644 --- a/keyboards/handwired/p65rgb/keyboard.json +++ b/keyboards/handwired/p65rgb/keyboard.json @@ -57,6 +57,100 @@ "solid_splash": true, "solid_multisplash": true }, + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"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": 119, "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": 1}, + {"x": 202, "y": 0, "flags": 1}, + {"matrix": [0, 14], "x": 209, "y": 0, "flags": 1}, + {"matrix": [0, 15], "x": 224, "y": 0, "flags": 4}, + + {"x": 224, "y": 8, "flags": 2}, + + {"matrix": [1, 15], "x": 224, "y": 16, "flags": 4}, + {"matrix": [1, 14], "x": 205, "y": 16, "flags": 1}, + {"matrix": [1, 12], "x": 187, "y": 16, "flags": 4}, + {"matrix": [1, 11], "x": 172, "y": 16, "flags": 4}, + {"matrix": [1, 10], "x": 157, "y": 16, "flags": 4}, + {"matrix": [1, 9], "x": 142, "y": 16, "flags": 4}, + {"matrix": [1, 8], "x": 127, "y": 16, "flags": 4}, + {"matrix": [1, 7], "x": 112, "y": 16, "flags": 4}, + {"matrix": [1, 6], "x": 97, "y": 16, "flags": 4}, + {"matrix": [1, 5], "x": 82, "y": 16, "flags": 4}, + {"matrix": [1, 4], "x": 67, "y": 16, "flags": 4}, + {"matrix": [1, 3], "x": 52, "y": 16, "flags": 4}, + {"matrix": [1, 2], "x": 37, "y": 16, "flags": 4}, + {"matrix": [1, 1], "x": 22, "y": 16, "flags": 4}, + {"matrix": [1, 0], "x": 4, "y": 16, "flags": 1}, + + {"x": 0, "y": 8, "flags": 2}, + {"x": 0, "y": 24, "flags": 2}, + + {"matrix": [2, 0], "x": 6, "y": 32, "flags": 1}, + {"matrix": [2, 1], "x": 26, "y": 32, "flags": 4}, + {"matrix": [2, 2], "x": 41, "y": 32, "flags": 4}, + {"matrix": [2, 3], "x": 56, "y": 32, "flags": 4}, + {"matrix": [2, 4], "x": 71, "y": 32, "flags": 4}, + {"matrix": [2, 5], "x": 86, "y": 32, "flags": 4}, + {"matrix": [2, 6], "x": 101, "y": 32, "flags": 4}, + {"matrix": [2, 7], "x": 116, "y": 32, "flags": 4}, + {"matrix": [2, 8], "x": 131, "y": 32, "flags": 4}, + {"matrix": [2, 9], "x": 146, "y": 32, "flags": 4}, + {"matrix": [2, 10], "x": 161, "y": 32, "flags": 4}, + {"matrix": [2, 11], "x": 175, "y": 32, "flags": 4}, + {"matrix": [2, 12], "x": 190, "y": 32, "flags": 4}, + {"x": 200, "y": 32, "flags": 1}, + {"matrix": [2, 14], "x": 207, "y": 32, "flags": 1}, + {"matrix": [2, 15], "x": 224, "y": 32, "flags": 4}, + + {"x": 224, "y": 24, "flags": 2}, + {"x": 224, "y": 40, "flags": 2}, + + {"matrix": [3, 15], "x": 224, "y": 48, "flags": 4}, + {"matrix": [3, 14], "x": 209, "y": 48, "flags": 4}, + {"matrix": [3, 12], "x": 189, "y": 48, "flags": 1}, + {"matrix": [3, 10], "x": 168, "y": 48, "flags": 4}, + {"matrix": [3, 9], "x": 153, "y": 48, "flags": 4}, + {"matrix": [3, 8], "x": 138, "y": 48, "flags": 4}, + {"matrix": [3, 7], "x": 123, "y": 48, "flags": 4}, + {"matrix": [3, 6], "x": 108, "y": 48, "flags": 4}, + {"matrix": [3, 5], "x": 93, "y": 48, "flags": 4}, + {"matrix": [3, 4], "x": 78, "y": 48, "flags": 4}, + {"matrix": [3, 3], "x": 63, "y": 48, "flags": 4}, + {"matrix": [3, 2], "x": 49, "y": 48, "flags": 4}, + {"matrix": [3, 1], "x": 34, "y": 48, "flags": 4}, + {"matrix": [3, 0], "x": 9, "y": 48, "flags": 1}, + + {"x": 0, "y": 40, "flags": 2}, + {"x": 0, "y": 56, "flags": 2}, + + {"matrix": [4, 0], "x": 2, "y": 64, "flags": 1}, + {"x": 4, "y": 64, "flags": 1}, + {"matrix": [4, 1], "x": 21, "y": 64, "flags": 1}, + {"x": 26, "y": 64, "flags": 1}, + {"matrix": [4, 2], "x": 39, "y": 64, "flags": 1}, + {"matrix": [4, 5], "x": 95, "y": 64, "flags": 4}, + {"x": 105, "y": 64, "flags": 4}, + {"matrix": [4, 9], "x": 151, "y": 64, "flags": 1}, + {"matrix": [4, 10], "x": 170, "y": 64, "flags": 1}, + {"x": 172, "y": 64, "flags": 1}, + {"matrix": [4, 12], "x": 194, "y": 64, "flags": 4}, + {"matrix": [4, 14], "x": 209, "y": 64, "flags": 4}, + {"matrix": [4, 15], "x": 224, "y": 64, "flags": 4}, + + {"x": 224, "y": 56, "flags": 2} + ], "driver": "ws2812", "led_flush_limit": 26, "led_process_limit": 4, @@ -84,7 +178,7 @@ } }, "matrix_pins": { - "cols": ["E6", "F0", "F1", "F4", "F5", "F6", "F7", "B0", "B1", "B2", "B3", "B7", "D0", "D1", "D2", "D3", "D7"], + "cols": ["E6", "F0", "F1", "F4", "F5", "F6", "F7", "B0", "B1", "B2", "B3", "B7", "D0", "D1", "D2", "D3"], "rows": ["C7", "C6", "B6", "B5", "D5"] }, "diode_direction": "COL2ROW", diff --git a/keyboards/handwired/p65rgb/p65rgb.c b/keyboards/handwired/p65rgb/p65rgb.c index 86bca2a7f9..3d7185f9d1 100644 --- a/keyboards/handwired/p65rgb/p65rgb.c +++ b/keyboards/handwired/p65rgb/p65rgb.c @@ -16,26 +16,7 @@ #include "quantum.h" -led_config_t g_led_config = { { - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }, - { 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17 }, - { 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50 }, - { 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51 }, - { 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82 } -}, { - { 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 }, {195, 0 }, {205, 0 }, {210, 0 }, {224, 0 }, - { 224,16 }, {224, 16 }, {210, 16 }, {180, 16 }, {165, 16 }, {150, 16 }, {135, 16 }, {120, 16 }, {105, 16 }, { 90, 16 }, { 75, 16 }, { 60, 16 }, { 45, 16 }, { 30, 16 }, { 15, 16 }, { 0, 16 }, { 0, 16 }, - { 0, 32 }, { 0, 32 }, { 15, 32 }, { 30, 32 }, { 45, 32 }, { 60, 32 }, { 75, 32 }, { 90, 32 }, {105, 32 }, {120, 32 }, {135, 32 }, {150, 32 }, {165, 32 }, {190, 32 }, {205, 32 }, {210, 32 }, {224, 32 }, - { 224, 8 }, {224, 48 }, {210, 48 }, {195, 48 }, {180, 48 }, {150, 48 }, {135, 48 }, {120, 48 }, {105, 48 }, { 90, 48 }, { 75, 48 }, { 60, 48 }, { 45, 48 }, { 30, 48 }, { 15, 48 }, { 0, 48 }, { 0, 48 }, - { 0, 64 }, { 0, 64 }, { 0, 64 }, { 15, 64 }, { 15, 64 }, { 40, 64 }, { 90, 64 }, {105, 64 }, {150, 64 }, {180, 64 }, {180, 64 }, {195, 64 }, {210, 64 }, {220, 64 }, {224, 64 } -}, { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 2, - 2, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, - 2, 2, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2 -} }; - +#ifdef RGB_MATRIX_ENABLE void suspend_power_down_kb(void) { rgb_matrix_set_suspend_state(true); @@ -47,3 +28,4 @@ void suspend_wakeup_init_kb(void) rgb_matrix_set_suspend_state(false); suspend_wakeup_init_user(); } +#endif