diff options
| author | Jack Sangdahl <jack@pngu.org> | 2025-10-08 08:01:08 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-08 08:01:08 -0600 |
| commit | 7dca4e8bda2031c7fa2c85fc9c7a5557e24256df (patch) | |
| tree | d6886b727d8558967bd646d6982fd895a2205e92 /keyboards | |
| parent | 0aae222ab6fd15355e5bc3b113b05484373cc8b1 (diff) | |
Fixup `kprepublic/bm60hsrgb_iso/rev2` (#25648)
Fixup kprepublic/bm60hsrgb_iso/rev2
- Remove RGBLight configuration and throw error if RGBLight & RGB Matrix
are enabled together - the WS2812 driver cannot be used for RGBLight
as it is being used by this keyboard's custom RGB Matrix driver
- Migrate RGB Matrix configuration to DD
- Migrate default keymap to JSON
- Use short SPDX license headers
Diffstat (limited to 'keyboards')
6 files changed, 110 insertions, 152 deletions
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h b/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h index 710e240aa4..1567ce3eb1 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/config.h | |||
| @@ -1,31 +1,9 @@ | |||
| 1 | /* Copyright 2021 bdtc123 | 1 | // Copyright 2021 bdtc123 |
| 2 | * Copyright 2021 sigprof | 2 | // Copyright 2021 sigprof |
| 3 | * Copyright 2021 peepeetee | 3 | // Copyright 2021 peepeetee |
| 4 | * | 4 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | * This program is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | #pragma once | 5 | #pragma once |
| 19 | 6 | ||
| 20 | #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND | 7 | #define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND |
| 21 | #define IS31FL3733_LED_COUNT 64 | 8 | #define IS31FL3733_LED_COUNT 64 |
| 22 | 9 | #define WS2812_LED_COUNT 6 | |
| 23 | // Underglow LEDs are WS2812, but someone might want to use RGBLIGHT for them; | ||
| 24 | // don't use those LEDs in RGB Matrix in that case. | ||
| 25 | #ifdef RGBLIGHT_ENABLE | ||
| 26 | # define WS2812_LED_COUNT 0 | ||
| 27 | #else | ||
| 28 | # define WS2812_LED_COUNT 6 | ||
| 29 | #endif | ||
| 30 | |||
| 31 | #define RGB_MATRIX_LED_COUNT (IS31FL3733_LED_COUNT + WS2812_LED_COUNT) | ||
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/keyboard.json b/keyboards/kprepublic/bm60hsrgb_iso/rev2/keyboard.json index 3a0df3e414..fec641b886 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/keyboard.json +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/keyboard.json | |||
| @@ -59,30 +59,81 @@ | |||
| 59 | "animation": "cycle_all" | 59 | "animation": "cycle_all" |
| 60 | }, | 60 | }, |
| 61 | "driver": "custom", | 61 | "driver": "custom", |
| 62 | "layout": [ | ||
| 63 | {"matrix": [0, 0], "x": 0, "y": 0, "flags": 4}, | ||
| 64 | {"matrix": [0, 1], "x": 15, "y": 0, "flags": 4}, | ||
| 65 | {"matrix": [0, 2], "x": 30, "y": 0, "flags": 4}, | ||
| 66 | {"matrix": [0, 3], "x": 45, "y": 0, "flags": 4}, | ||
| 67 | {"matrix": [0, 4], "x": 60, "y": 0, "flags": 4}, | ||
| 68 | {"matrix": [0, 5], "x": 75, "y": 0, "flags": 4}, | ||
| 69 | {"matrix": [0, 6], "x": 90, "y": 0, "flags": 4}, | ||
| 70 | {"matrix": [0, 7], "x": 105, "y": 0, "flags": 4}, | ||
| 71 | {"matrix": [0, 8], "x": 120, "y": 0, "flags": 4}, | ||
| 72 | {"matrix": [0, 9], "x": 135, "y": 0, "flags": 4}, | ||
| 73 | {"matrix": [0, 10], "x": 150, "y": 0, "flags": 4}, | ||
| 74 | {"matrix": [0, 11], "x": 165, "y": 0, "flags": 4}, | ||
| 75 | {"matrix": [0, 12], "x": 180, "y": 0, "flags": 4}, | ||
| 76 | {"matrix": [0, 13], "x": 202, "y": 0, "flags": 1}, | ||
| 77 | {"matrix": [1, 0], "x": 7, "y": 16, "flags": 1}, | ||
| 78 | {"matrix": [1, 1], "x": 22, "y": 16, "flags": 4}, | ||
| 79 | {"matrix": [1, 2], "x": 37, "y": 16, "flags": 4}, | ||
| 80 | {"matrix": [1, 3], "x": 52, "y": 16, "flags": 4}, | ||
| 81 | {"matrix": [1, 4], "x": 67, "y": 16, "flags": 4}, | ||
| 82 | {"matrix": [1, 5], "x": 82, "y": 16, "flags": 4}, | ||
| 83 | {"matrix": [1, 6], "x": 97, "y": 16, "flags": 4}, | ||
| 84 | {"matrix": [1, 7], "x": 112, "y": 16, "flags": 4}, | ||
| 85 | {"matrix": [1, 8], "x": 127, "y": 16, "flags": 4}, | ||
| 86 | {"matrix": [1, 9], "x": 142, "y": 16, "flags": 4}, | ||
| 87 | {"matrix": [1, 10], "x": 157, "y": 16, "flags": 4}, | ||
| 88 | {"matrix": [1, 11], "x": 172, "y": 16, "flags": 4}, | ||
| 89 | {"matrix": [1, 12], "x": 187, "y": 16, "flags": 4}, | ||
| 90 | {"matrix": [1, 13], "x": 206, "y": 16, "flags": 1}, | ||
| 91 | {"matrix": [2, 0], "x": 11, "y": 32, "flags": 9}, | ||
| 92 | {"matrix": [2, 1], "x": 26, "y": 32, "flags": 4}, | ||
| 93 | {"matrix": [2, 2], "x": 41, "y": 32, "flags": 4}, | ||
| 94 | {"matrix": [2, 3], "x": 56, "y": 32, "flags": 4}, | ||
| 95 | {"matrix": [2, 4], "x": 71, "y": 32, "flags": 4}, | ||
| 96 | {"matrix": [2, 5], "x": 86, "y": 32, "flags": 4}, | ||
| 97 | {"matrix": [2, 6], "x": 101, "y": 32, "flags": 4}, | ||
| 98 | {"matrix": [2, 7], "x": 116, "y": 32, "flags": 4}, | ||
| 99 | {"matrix": [2, 8], "x": 131, "y": 32, "flags": 4}, | ||
| 100 | {"matrix": [2, 9], "x": 146, "y": 32, "flags": 4}, | ||
| 101 | {"matrix": [2, 10], "x": 161, "y": 32, "flags": 4}, | ||
| 102 | {"matrix": [2, 11], "x": 176, "y": 32, "flags": 4}, | ||
| 103 | {"matrix": [2, 12], "x": 198, "y": 32, "flags": 4}, | ||
| 104 | {"matrix": [3, 0], "x": 3, "y": 48, "flags": 1}, | ||
| 105 | {"matrix": [3, 2], "x": 22, "y": 48, "flags": 4}, | ||
| 106 | {"matrix": [3, 3], "x": 33, "y": 48, "flags": 4}, | ||
| 107 | {"matrix": [3, 4], "x": 48, "y": 48, "flags": 4}, | ||
| 108 | {"matrix": [3, 5], "x": 63, "y": 48, "flags": 4}, | ||
| 109 | {"matrix": [3, 6], "x": 78, "y": 48, "flags": 4}, | ||
| 110 | {"matrix": [3, 7], "x": 93, "y": 48, "flags": 4}, | ||
| 111 | {"matrix": [3, 8], "x": 108, "y": 48, "flags": 4}, | ||
| 112 | {"matrix": [3, 9], "x": 123, "y": 48, "flags": 4}, | ||
| 113 | {"x": 138, "y": 48, "flags": 4}, | ||
| 114 | {"matrix": [3, 10], "x": 153, "y": 48, "flags": 4}, | ||
| 115 | {"matrix": [3, 11], "x": 168, "y": 48, "flags": 1}, | ||
| 116 | {"matrix": [3, 12], "x": 194, "y": 48, "flags": 1}, | ||
| 117 | {"matrix": [3, 13], "x": 213, "y": 48, "flags": 4}, | ||
| 118 | {"matrix": [4, 0], "x": 3, "y": 64, "flags": 1}, | ||
| 119 | {"matrix": [4, 1], "x": 22, "y": 64, "flags": 1}, | ||
| 120 | {"matrix": [4, 2], "x": 33, "y": 64, "flags": 1}, | ||
| 121 | {"matrix": [4, 5], "x": 101, "y": 64, "flags": 4}, | ||
| 122 | {"matrix": [4, 9], "x": 135, "y": 64, "flags": 1}, | ||
| 123 | {"matrix": [4, 10], "x": 153, "y": 64, "flags": 1}, | ||
| 124 | {"matrix": [4, 11], "x": 195, "y": 64, "flags": 1}, | ||
| 125 | {"matrix": [4, 12], "x": 210, "y": 64, "flags": 1}, | ||
| 126 | {"matrix": [4, 13], "x": 224, "y": 64, "flags": 1}, | ||
| 127 | {"x": 28, "y": 40, "flags": 2}, | ||
| 128 | {"x": 62, "y": 40, "flags": 2}, | ||
| 129 | {"x": 96, "y": 40, "flags": 2}, | ||
| 130 | {"x": 130, "y": 40, "flags": 2}, | ||
| 131 | {"x": 164, "y": 40, "flags": 2}, | ||
| 132 | {"x": 198, "y": 40, "flags": 2} | ||
| 133 | ], | ||
| 62 | "max_brightness": 180, | 134 | "max_brightness": 180, |
| 63 | "sleep": true | 135 | "sleep": true |
| 64 | }, | 136 | }, |
| 65 | "rgblight": { | ||
| 66 | "saturation_steps": 8, | ||
| 67 | "brightness_steps": 8, | ||
| 68 | "led_count": 6, | ||
| 69 | "max_brightness": 150, | ||
| 70 | "animations": { | ||
| 71 | "breathing": true, | ||
| 72 | "rainbow_mood": true, | ||
| 73 | "rainbow_swirl": true, | ||
| 74 | "snake": true, | ||
| 75 | "knight": true, | ||
| 76 | "christmas": true, | ||
| 77 | "static_gradient": true, | ||
| 78 | "rgb_test": true, | ||
| 79 | "alternating": true, | ||
| 80 | "twinkle": true | ||
| 81 | }, | ||
| 82 | "default": { | ||
| 83 | "animation": "rainbow_mood" | ||
| 84 | } | ||
| 85 | }, | ||
| 86 | "matrix_pins": { | 137 | "matrix_pins": { |
| 87 | "cols": ["B2", "B3", "B7", "B0", "B1", "F7", "D4", "D6", "D7", "B4", "B5", "B6", "C6", "C7"], | 138 | "cols": ["B2", "B3", "B7", "B0", "B1", "F7", "D4", "D6", "D7", "B4", "B5", "B6", "C6", "C7"], |
| 88 | "rows": ["E6", "D2", "D3", "D5", "F6"] | 139 | "rows": ["E6", "D2", "D3", "D5", "F6"] |
| @@ -118,7 +169,6 @@ | |||
| 118 | {"matrix": [0, 11], "x": 11, "y": 0}, | 169 | {"matrix": [0, 11], "x": 11, "y": 0}, |
| 119 | {"matrix": [0, 12], "x": 12, "y": 0}, | 170 | {"matrix": [0, 12], "x": 12, "y": 0}, |
| 120 | {"matrix": [0, 13], "x": 13, "y": 0, "w": 2}, | 171 | {"matrix": [0, 13], "x": 13, "y": 0, "w": 2}, |
| 121 | |||
| 122 | {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, | 172 | {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5}, |
| 123 | {"matrix": [1, 1], "x": 1.5, "y": 1}, | 173 | {"matrix": [1, 1], "x": 1.5, "y": 1}, |
| 124 | {"matrix": [1, 2], "x": 2.5, "y": 1}, | 174 | {"matrix": [1, 2], "x": 2.5, "y": 1}, |
| @@ -132,7 +182,6 @@ | |||
| 132 | {"matrix": [1, 10], "x": 10.5, "y": 1}, | 182 | {"matrix": [1, 10], "x": 10.5, "y": 1}, |
| 133 | {"matrix": [1, 11], "x": 11.5, "y": 1}, | 183 | {"matrix": [1, 11], "x": 11.5, "y": 1}, |
| 134 | {"matrix": [1, 12], "x": 12.5, "y": 1}, | 184 | {"matrix": [1, 12], "x": 12.5, "y": 1}, |
| 135 | |||
| 136 | {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, | 185 | {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75}, |
| 137 | {"matrix": [2, 1], "x": 1.75, "y": 2}, | 186 | {"matrix": [2, 1], "x": 1.75, "y": 2}, |
| 138 | {"matrix": [2, 2], "x": 2.75, "y": 2}, | 187 | {"matrix": [2, 2], "x": 2.75, "y": 2}, |
| @@ -147,7 +196,6 @@ | |||
| 147 | {"matrix": [2, 11], "x": 11.75, "y": 2}, | 196 | {"matrix": [2, 11], "x": 11.75, "y": 2}, |
| 148 | {"matrix": [2, 12], "x": 12.75, "y": 2}, | 197 | {"matrix": [2, 12], "x": 12.75, "y": 2}, |
| 149 | {"matrix": [1, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, | 198 | {"matrix": [1, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2}, |
| 150 | |||
| 151 | {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, | 199 | {"matrix": [3, 0], "x": 0, "y": 3, "w": 1.25}, |
| 152 | {"matrix": [4, 3], "x": 1.25, "y": 3}, | 200 | {"matrix": [4, 3], "x": 1.25, "y": 3}, |
| 153 | {"matrix": [3, 1], "x": 2.25, "y": 3}, | 201 | {"matrix": [3, 1], "x": 2.25, "y": 3}, |
| @@ -162,7 +210,6 @@ | |||
| 162 | {"matrix": [3, 11], "x": 11.25, "y": 3, "w": 1.75}, | 210 | {"matrix": [3, 11], "x": 11.25, "y": 3, "w": 1.75}, |
| 163 | {"matrix": [3, 12], "x": 13, "y": 3}, | 211 | {"matrix": [3, 12], "x": 13, "y": 3}, |
| 164 | {"matrix": [3, 13], "x": 14, "y": 3}, | 212 | {"matrix": [3, 13], "x": 14, "y": 3}, |
| 165 | |||
| 166 | {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, | 213 | {"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25}, |
| 167 | {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, | 214 | {"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25}, |
| 168 | {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, | 215 | {"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25}, |
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.c b/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.c deleted file mode 100644 index f3aa8083f1..0000000000 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.c +++ /dev/null | |||
| @@ -1,34 +0,0 @@ | |||
| 1 | /* Copyright 2020 markva | ||
| 2 | * Copyright 2021 bdtc123 | ||
| 3 | * | ||
| 4 | * This program is free software: you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation, either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 20 | [0] = LAYOUT_60_iso_arrow( | ||
| 21 | QK_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, | ||
| 22 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, | ||
| 23 | KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, | ||
| 24 | KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, | ||
| 25 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT | ||
| 26 | ), | ||
| 27 | [1] = LAYOUT_60_iso_arrow( | ||
| 28 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, QK_BOOT, | ||
| 29 | _______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, RM_VALU, RM_VALD, _______, _______, _______, _______, | ||
| 30 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 31 | _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, KC_PGUP, _______, | ||
| 32 | _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END | ||
| 33 | ) | ||
| 34 | }; | ||
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.json b/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.json new file mode 100644 index 0000000000..ea074ba006 --- /dev/null +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/keymaps/default/keymap.json | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | { | ||
| 2 | "keyboard": "kprepublic/bm60hsrgb_iso/rev2", | ||
| 3 | "keymap": "default", | ||
| 4 | "layout": "LAYOUT_60_iso_arrow", | ||
| 5 | "layers": [ | ||
| 6 | [ | ||
| 7 | "QK_GESC", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSPC", | ||
| 8 | "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRC", "KC_RBRC", | ||
| 9 | "KC_CAPS", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_NUHS", "KC_ENT", | ||
| 10 | "KC_LSFT", "KC_NUBS", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_RSFT", "KC_UP", "KC_SLSH", | ||
| 11 | "KC_LCTL", "KC_LGUI", "KC_LALT", "KC_SPC", "KC_RALT", "MO(1)", "KC_LEFT", "KC_DOWN", "KC_RGHT" | ||
| 12 | ], | ||
| 13 | [ | ||
| 14 | "_______", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "QK_BOOT", | ||
| 15 | "_______", "RM_TOGG", "RM_NEXT", "RM_HUEU", "RM_HUED", "RM_SATU", "RM_SATD", "RM_VALU", "RM_VALD", "_______", "_______", "_______", "_______", | ||
| 16 | "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", "_______", | ||
| 17 | "_______", "_______", "_______", "_______", "_______", "_______", "NK_TOGG", "_______", "_______", "_______", "_______", "KC_PGUP", "_______", | ||
| 18 | "_______", "_______", "_______", "_______", "_______", "_______", "KC_HOME", "KC_PGDN", "KC_END" | ||
| 19 | ] | ||
| 20 | ] | ||
| 21 | } | ||
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c index 0d52d1bacb..9e617bb8ef 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c | |||
| @@ -1,29 +1,20 @@ | |||
| 1 | /* Copyright 2021 bdtc123 | 1 | // Copyright 2021 bdtc123 |
| 2 | * Copyright 2021 sigprof | 2 | // Copyright 2021 sigprof |
| 3 | * Copyright 2021 peepeetee | 3 | // Copyright 2021 peepeetee |
| 4 | * | 4 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 5 | * This program is free software: you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License as published by | ||
| 7 | * the Free Software Foundation, either version 2 of the License, or | ||
| 8 | * (at your option) any later version. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License | ||
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 17 | */ | ||
| 18 | #include "quantum.h" | 5 | #include "quantum.h" |
| 19 | 6 | ||
| 7 | #if defined(RGB_MATRIX_ENABLE) && defined(RGBLIGHT_ENABLE) | ||
| 8 | # error "RGBLight must not be enabled due to this keyboard's custom RGB Matrix driver" | ||
| 9 | #endif | ||
| 10 | |||
| 20 | #ifdef RGB_MATRIX_ENABLE | 11 | #ifdef RGB_MATRIX_ENABLE |
| 21 | 12 | ||
| 22 | # include "i2c_master.h" | 13 | # include "i2c_master.h" |
| 23 | # include "is31fl3733.h" | 14 | # include "is31fl3733.h" |
| 24 | # include "ws2812.h" | 15 | # include "ws2812.h" |
| 25 | 16 | ||
| 26 | 17 | // clang-format off | |
| 27 | const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { | 18 | const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { |
| 28 | { 0, SW2_CS1, SW1_CS1, SW3_CS1 }, | 19 | { 0, SW2_CS1, SW1_CS1, SW3_CS1 }, |
| 29 | { 0, SW2_CS2, SW1_CS2, SW3_CS2 }, | 20 | { 0, SW2_CS2, SW1_CS2, SW3_CS2 }, |
| @@ -94,42 +85,7 @@ const is31fl3733_led_t PROGMEM g_is31fl3733_leds[IS31FL3733_LED_COUNT] = { | |||
| 94 | { 0, SW2_CS15, SW1_CS15, SW3_CS15 }, | 85 | { 0, SW2_CS15, SW1_CS15, SW3_CS15 }, |
| 95 | { 0, SW5_CS16, SW4_CS16, SW6_CS16 } | 86 | { 0, SW5_CS16, SW4_CS16, SW6_CS16 } |
| 96 | }; | 87 | }; |
| 97 | 88 | // clang-format on | |
| 98 | led_config_t g_led_config = { { | ||
| 99 | { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, | ||
| 100 | { 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 }, | ||
| 101 | { 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,NO_LED}, | ||
| 102 | { 41, 58, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54 }, | ||
| 103 | { 55, 56, 57,NO_LED,NO_LED, 58,NO_LED,NO_LED,NO_LED, 59, 60, 61, 62, 63 } | ||
| 104 | }, { | ||
| 105 | // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace | ||
| 106 | { 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 }, | ||
| 107 | // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], , | ||
| 108 | { 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 }, | ||
| 109 | // Capslock, A, S, D, F, G, H, J, K, L, ;, ', Enter | ||
| 110 | { 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 }, | ||
| 111 | // LShift, <, Z, X, C, V, B, N, M, ,, ., /, Shift, Up, | ||
| 112 | { 3, 48 }, { 22, 48 }, { 33, 48 }, { 48, 48 }, { 63, 48 }, { 78, 48 }, { 93, 48 }, { 108, 48 }, { 123, 48 }, { 138, 48 }, { 153, 48 }, { 168, 48 }, { 194, 48 }, { 213, 48 }, | ||
| 113 | // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right | ||
| 114 | { 3, 64 }, { 22, 64 }, { 33, 64 }, { 101, 64 }, { 135, 64 }, { 153, 64 }, { 195, 64 }, { 210, 64 }, { 225, 64 } | ||
| 115 | # if WS2812_LED_COUNT > 0 | ||
| 116 | ,{ 28, 40}, { 62, 40}, { 96, 40}, {130, 40}, {164, 40}, {198, 40} | ||
| 117 | # endif | ||
| 118 | }, { | ||
| 119 | // Esc, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, Backspace | ||
| 120 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 121 | // Tab, Q, W, E, R, T, Y, U, I, O, P, [, ], Enter | ||
| 122 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, | ||
| 123 | // Capslock, A, S, D, F, G, H, J, K, L, ;, ',# | ||
| 124 | 9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, | ||
| 125 | // LShift,backslash, Z, X, C, V, B, N, M, ,, ., Shift, Up, / | ||
| 126 | 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 4, | ||
| 127 | // Ctrl, GUI, Alt, Space, RAlt, FN, Left, Down, Right | ||
| 128 | 1, 1, 1, 4, 1, 1, 1, 1, 1 | ||
| 129 | # if WS2812_LED_COUNT > 0 | ||
| 130 | ,2, 2, 2, 2, 2, 2 | ||
| 131 | # endif | ||
| 132 | } }; | ||
| 133 | 89 | ||
| 134 | bool rgb_matrix_indicators_kb(void) { | 90 | bool rgb_matrix_indicators_kb(void) { |
| 135 | if (!rgb_matrix_indicators_user()) { | 91 | if (!rgb_matrix_indicators_user()) { |
| @@ -141,8 +97,6 @@ bool rgb_matrix_indicators_kb(void) { | |||
| 141 | return true; | 97 | return true; |
| 142 | } | 98 | } |
| 143 | 99 | ||
| 144 | // clang-format on | ||
| 145 | |||
| 146 | // ========================================================================== | 100 | // ========================================================================== |
| 147 | // Custom RGB Matrix driver that combines IS31FL3733 and WS2812 | 101 | // Custom RGB Matrix driver that combines IS31FL3733 and WS2812 |
| 148 | // ========================================================================== | 102 | // ========================================================================== |
| @@ -160,26 +114,20 @@ static void rgb_matrix_driver_init(void) { | |||
| 160 | 114 | ||
| 161 | static void rgb_matrix_driver_flush(void) { | 115 | static void rgb_matrix_driver_flush(void) { |
| 162 | is31fl3733_update_pwm_buffers(0); | 116 | is31fl3733_update_pwm_buffers(0); |
| 163 | # if WS2812_LED_COUNT > 0 | ||
| 164 | ws2812_flush(); | 117 | ws2812_flush(); |
| 165 | # endif | ||
| 166 | } | 118 | } |
| 167 | 119 | ||
| 168 | static void rgb_matrix_driver_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { | 120 | static void rgb_matrix_driver_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { |
| 169 | if (index < IS31FL3733_LED_COUNT) { | 121 | if (index < IS31FL3733_LED_COUNT) { |
| 170 | is31fl3733_set_color(index, red, green, blue); | 122 | is31fl3733_set_color(index, red, green, blue); |
| 171 | # if WS2812_LED_COUNT > 0 | ||
| 172 | } else { | 123 | } else { |
| 173 | ws2812_set_color(index - IS31FL3733_LED_COUNT, red, green, blue); | 124 | ws2812_set_color(index - IS31FL3733_LED_COUNT, red, green, blue); |
| 174 | # endif | ||
| 175 | } | 125 | } |
| 176 | } | 126 | } |
| 177 | 127 | ||
| 178 | static void rgb_matrix_driver_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { | 128 | static void rgb_matrix_driver_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { |
| 179 | is31fl3733_set_color_all(red, green, blue); | 129 | is31fl3733_set_color_all(red, green, blue); |
| 180 | # if WS2812_LED_COUNT > 0 | ||
| 181 | ws2812_set_color_all(red, green, blue); | 130 | ws2812_set_color_all(red, green, blue); |
| 182 | # endif | ||
| 183 | } | 131 | } |
| 184 | 132 | ||
| 185 | // clang-format off | 133 | // clang-format off |
diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rules.mk b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rules.mk index 7012deda8c..bb6c11ea53 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rules.mk +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rules.mk | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | # The custom RGB Matrix driver combines IS31FL3733 and WS2812; things that are | 1 | WS2812_DRIVER_REQUIRED = yes |
| 2 | # normally done by common_features.mk for both of these drivers need to be done | 2 | |
| 3 | # here manually. | ||
| 4 | COMMON_VPATH += $(DRIVER_PATH)/led/issi | 3 | COMMON_VPATH += $(DRIVER_PATH)/led/issi |
| 5 | SRC += is31fl3733.c | 4 | SRC += is31fl3733.c |
| 6 | I2C_DRIVER_REQUIRED = yes | 5 | I2C_DRIVER_REQUIRED = yes |
| 7 | WS2812_DRIVER_REQUIRED = yes | ||
