diff options
| author | Jack Sangdahl | 2025-09-09 11:03:52 +0200 |
|---|---|---|
| committer | GitHub | 2025-09-09 11:03:52 +0200 |
| commit | c1b428bb4e4d2ecf4b904c8e4886d8e8e37602c7 (patch) | |
| tree | dad21216d16f0013e9772fd9e13110522f592c21 /keyboards/joshajohnson | |
| parent | 0828fc4b6ff126b2466bd92110770ac412a1ad56 (diff) | |
Migrate `g_led_config` to DD (JK1) (#25601)
Diffstat (limited to 'keyboards/joshajohnson')
| -rw-r--r-- | keyboards/joshajohnson/hub20/hub20.c | 171 | ||||
| -rw-r--r-- | keyboards/joshajohnson/hub20/keyboard.json | 31 |
2 files changed, 30 insertions, 172 deletions
diff --git a/keyboards/joshajohnson/hub20/hub20.c b/keyboards/joshajohnson/hub20/hub20.c deleted file mode 100644 index 8b1c58e1f7..0000000000 --- a/keyboards/joshajohnson/hub20/hub20.c +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright 2020 joshajohnson 2021 peepeetee - * - * 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 <http://www.gnu.org/licenses/>. - */ - -#include "quantum.h" - - -#ifdef RGB_MATRIX_ENABLE -led_config_t g_led_config = { { - // Key Matrix to LED Index - {NO_LED,NO_LED,NO_LED,NO_LED}, - { 7, 8, 9, 10}, - { 11, 12, 13, 14}, - { 15, 16, 17, 18}, - { 19, 20, 21, 22}, - { 23, 24, 25, 26} - //todo: assign leds to keys differently for the different layouts -}, { - // LED Index to Physical Position - { 190, 50}, { 111, 50}, { 35, 50}, {38, 0}, {38, 35}, {186, 35}, {186, 0}, // UNDERGLOW - //todo: underglow location needs to be recalculated. The top row is above row 4, and for now they have the same y value 0 - { 0, 0}, {75, 0}, {150, 0}, {225, 0}, // row 4 - { 0, 16}, {75, 16}, {150, 16}, {225, 16}, // row 3 - { 0, 32}, {75, 32}, {150, 32}, {225, 32}, // row 2 - { 0, 48}, {75, 48}, {150, 48}, {225, 48}, // row 1 - { 0, 64}, {75, 64}, {150, 64}, {225, 64} // row 0 - -}, { - // LED Index to Flag - LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, // UNDERGLOW - LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 4 - LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 3 - LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 2 - LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 1 - LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT // row 0 - -} }; -#endif - - - -// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER && LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO -// #error lower left enter conflicts with lower left zero -// #endif - -// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER && LED_MERGE_NUMPAD_LEFT_HANDED_ZERO -// #error lower right enter conflicts with lower right zero -// #endif - -// /* LAYOUT_left_handed - - -// * ┌───┬───┐ -// * │01 │02 │ -// * ┌───┼───┼───┼───┐ -// * │10 │11 │12 │13 │ -// * ├───┼───┼───┼───┤ -// * │ │21 │22 │23 │ -// * │20 ├───┼───┼───┤ -// * │ │31 │32 │33 │ -// * ├───┼───┼───┼───┤ -// * │ │41 │42 │43 │ -// * │40 ├───┼───┴───┤ -// * │ │51 │ 52 │ -// * └───┴───┴───────┘ -// */ - -// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20 -// #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS FALSE -// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_PLUS - -// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40 -// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER FALSE -// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ENTER - -// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52 -// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO FALSE -// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ZERO - - -// /* LAYOUT_right_handed - - -// * ┌───┬───┐ -// * │01 │02 │ -// * ┌───┼───┼───┼───┐ -// * │10 │11 │12 │13 │ -// * ├───┼───┼───┼───┤ -// * │20 │21 │22 │ │ -// * ├───┼───┼───┤23 │ -// * │30 │31 │32 │ │ -// * ├───┼───┼───┼───┤ -// * │40 │41 │42 │ │ -// * ├───┴───┼───┤43 │ -// * │ 50 │52 │ │ -// * └───────┴───┴───┘ -// */ -// //LOCATION OF bottom row 0 NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER - -// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23 -// #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS FALSE -// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS - -// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43 -// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER FALSE -// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER - -// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer) -// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO FALSE -// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO - -// uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { -// // Keys here have 2 leds. Here we add the led that is not bound to the key -// // and the default led would be added -// // by the default code that runs after this in rgb_matrix_map_row_column_to_led - -// uint8_t counter = 0; - -// #if LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20, leds 7 and 11, 7 already bound - -// if (row == 2 && column == 0) { -// led_i[counter] = 11; -// counter ++; -// } -// #endif -// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40, leds 19 and 23, 23 already bound -// if (row == 4 && column == 0) { -// led_i[counter] = 23; -// counter ++; -// } -// #endif -// #if LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52, leds 25 and 26, 26 already bound -// if (row == 5 && column == 2) { -// led_i[counter] = 26; -// counter ++; -// } -// #endif - -// #if LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23, led 14 and 18, 14 already bound -// if (row == 2 && column == 3) { -// led_i[counter] = 18; -// counter ++; -// } -// #endif -// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43, led 22 and 26, 22 already bound -// if (row == 4 && column == 3) { -// led_i[counter] = 26; -// counter ++; -// } -// #endif -// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer) -// // LED 23 and 24, 23(?) already bound -// if (row == 5 && column == 0) { -// led_i[counter] = 24; -// counter ++; -// } -// #endif -// return counter; -// } diff --git a/keyboards/joshajohnson/hub20/keyboard.json b/keyboards/joshajohnson/hub20/keyboard.json index 0d557c58b5..c26a25de3c 100644 --- a/keyboards/joshajohnson/hub20/keyboard.json +++ b/keyboards/joshajohnson/hub20/keyboard.json @@ -28,7 +28,36 @@ "solid_reactive_simple": true, "solid_reactive": true }, - "driver": "ws2812" + "driver": "ws2812", + "layout": [ + {"x": 190, "y": 50, "flags": 2}, + {"x": 111, "y": 50, "flags": 2}, + {"x": 35, "y": 50, "flags": 2}, + {"x": 38, "y": 0, "flags": 2}, + {"x": 38, "y": 35, "flags": 2}, + {"x": 186, "y": 35, "flags": 2}, + {"x": 186, "y": 0, "flags": 2}, + {"matrix": [1, 0], "x": 0, "y": 0, "flags": 4}, + {"matrix": [1, 1], "x": 75, "y": 0, "flags": 4}, + {"matrix": [1, 2], "x": 150, "y": 0, "flags": 4}, + {"matrix": [1, 3], "x": 224, "y": 0, "flags": 4}, + {"matrix": [2, 0], "x": 0, "y": 16, "flags": 4}, + {"matrix": [2, 1], "x": 75, "y": 16, "flags": 4}, + {"matrix": [2, 2], "x": 150, "y": 16, "flags": 4}, + {"matrix": [2, 3], "x": 224, "y": 16, "flags": 4}, + {"matrix": [3, 0], "x": 0, "y": 32, "flags": 4}, + {"matrix": [3, 1], "x": 75, "y": 32, "flags": 4}, + {"matrix": [3, 2], "x": 150, "y": 32, "flags": 4}, + {"matrix": [3, 3], "x": 224, "y": 32, "flags": 4}, + {"matrix": [4, 0], "x": 0, "y": 48, "flags": 4}, + {"matrix": [4, 1], "x": 75, "y": 48, "flags": 4}, + {"matrix": [4, 2], "x": 150, "y": 48, "flags": 4}, + {"matrix": [4, 3], "x": 224, "y": 48, "flags": 4}, + {"matrix": [5, 0], "x": 0, "y": 64, "flags": 4}, + {"matrix": [5, 1], "x": 75, "y": 64, "flags": 4}, + {"matrix": [5, 2], "x": 150, "y": 64, "flags": 4}, + {"matrix": [5, 3], "x": 224, "y": 64, "flags": 4} + ] }, "features": { "bootmagic": true, |