diff options
author | Drashna Jaelre <drashna@live.com> | 2022-10-04 15:24:22 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 15:24:22 -0700 |
commit | 64b1ed45507a15d5594b1f90b936c2096918f5a4 (patch) | |
tree | 8824b1d4f55797d7608d3111a2755e919040e834 /keyboards/kprepublic | |
parent | 09d3e2771099ff1ca7e7bd8882644eb2b2807763 (diff) |
Fix Per Key LED Indicator Callbacks (#18450)
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'keyboards/kprepublic')
22 files changed, 205 insertions, 173 deletions
diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/coffee/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/coffee/keymap.c index ba83e47f5f..f988956451 100644 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/coffee/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/coffee/keymap.c @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, MCR_REC, XXXXXXX, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, MCR_PLY, XXXXXXX, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, XXXXXXX, MCR_SWT, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ) }; @@ -72,8 +72,8 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = { #ifdef UNDERGLOW_DISABLE void keyboard_pre_init_user(void) { - - for (int key_id = 0; key_id < RGB_MATRIX_LED_COUNT; key_id++ ) { + + for (int key_id = 0; key_id < DRIVER_LED_TOTAL; key_id++ ) { if (g_led_config.flags[key_id] == LED_FLAG_UNDERGLOW) { g_led_config.flags[key_id] = LED_FLAG_NONE; } @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = { } #endif - void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if (LAYER != _MAIN) { int DimmedMax = UINT8_MAX - (UINT8_MAX - rgb_matrix_config.hsv.v); @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = { for (uint8_t i = led_min; i <= led_max; i++) { uint8_t pos = ((uint8_t*)g_led_config.matrix_co)[i]; - + CHECK_LED(); // Check LED before moving on uint16_t KC = pgm_read_word(&((uint16_t*)keymaps)[(LAYER_SIZE * LAYER) + i]); @@ -111,6 +111,7 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = { } } + return false; } #endif @@ -162,4 +163,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { default: return true; //Process all other keycodes normally } -}
\ No newline at end of file +} diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/dan/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/dan/keymap.c index 29e359b94a..2ec9a5f9b3 100644 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/dan/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/dan/keymap.c @@ -257,7 +257,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { uint8_t red[3] = {50, 5, 0}; uint8_t yellow[3] = {50, 50, 0}; uint8_t blue[3] = {0, 15, 50}; @@ -323,5 +323,5 @@ void rgb_matrix_indicators_user(void) { if (led_state.scroll_lock) { rgb_matrix_set_color(23, green[0], green[1], green[2]); } - + return false; } diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c index 12db3f2eec..71cd9f074e 100755 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c @@ -1,17 +1,17 @@ /* Copyright 2021 Gabriel Bustamante Toledo - * - * 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/>. + * + * 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 QMK_KEYBOARD_H @@ -36,7 +36,7 @@ void set_color(int r, int g, int b){ rgb_matrix_set_color(41, r, g, b); } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { switch (get_highest_layer(layer_state)) { case BASE2: @@ -53,7 +53,7 @@ void rgb_matrix_indicators_user(void) { break; case SYM: set_color(0, 50, 1.9); - break; + break; case NUM: set_color(10, 0, 50); break; @@ -61,6 +61,7 @@ void rgb_matrix_indicators_user(void) { set_color(50, 0, 0); break; } + return false; } const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -122,4 +123,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; - diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c index 1e97aba495..5e0d4afa32 100644 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt/keymap.c @@ -67,7 +67,7 @@ void matrix_scan_user(void) { //layer led colors -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { //game indicators @@ -160,6 +160,7 @@ if(IS_LAYER_ON(NSSL)) { rgb_matrix_set_color(28, 0, 50, 1.9); rgb_matrix_set_color(29, 0, 50, 1.9); + return false; } //capslock leds diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_loud/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_loud/keymap.c index 6411a07d4f..1d274880c2 100644 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_loud/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_loud/keymap.c @@ -67,7 +67,7 @@ void matrix_scan_user(void) { //layer led colors -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; ++i) { if (HAS_ANY_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { @@ -141,6 +141,7 @@ void rgb_matrix_indicators_user(void) { } } + return false; } //tap dance declarations diff --git a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_quiet/keymap.c b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_quiet/keymap.c index 8f1eb6d358..d1c33599a2 100644 --- a/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_quiet/keymap.c +++ b/keyboards/kprepublic/bm40hsrgb/keymaps/signynt_2_quiet/keymap.c @@ -67,7 +67,7 @@ void matrix_scan_user(void) { //layer led colors -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { for (uint8_t i = 0; i < RGB_MATRIX_LED_COUNT; ++i) { if (HAS_ANY_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { @@ -105,6 +105,7 @@ void rgb_matrix_indicators_user(void) { } } + return false; } //tap dance declarations diff --git a/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c index 55e0667f45..bcf69323a7 100644 --- a/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb/rev2/rev2.c @@ -130,11 +130,14 @@ led_config_t g_led_config = { } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } + return true; } diff --git a/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c b/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c index 5dc0e8dc1d..9f7333b721 100644 --- a/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c +++ b/keyboards/kprepublic/bm60hsrgb_ec/rev1/rev1.c @@ -48,11 +48,14 @@ led_config_t g_led_config = { { 2, 2, 2, 2, 2, 2 } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } + return true; } #ifdef ENCODER_ENABLE diff --git a/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c index fd964a67cd..6cb40e0622 100644 --- a/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_ec/rev2/rev2.c @@ -117,11 +117,14 @@ led_config_t g_led_config = { } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } + return true; } #endif diff --git a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c index 7144db99ef..9ea82691e2 100644 --- a/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_iso/rev2/rev2.c @@ -131,11 +131,14 @@ led_config_t g_led_config = { { # endif } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } + return true; } // clang-format on diff --git a/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/david/keymap.c b/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/david/keymap.c index fb7e9c33c3..8da5f08572 100644 --- a/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/david/keymap.c +++ b/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/david/keymap.c @@ -1,23 +1,23 @@ /* Copyright 2021 David Martinz - * - * 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/>. - */ + * + * 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 QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi(KC_ESC, 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, - 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, KC_BSLS, + 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, KC_BSLS, 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_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), @@ -29,11 +29,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; #ifdef RGB_MATRIX_ENABLE -void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { // caps lock white if (host_keyboard_led_state().caps_lock) { RGB_MATRIX_INDICATOR_SET_COLOR(28, 200, 200, 200); - } + } // layer state switch (get_highest_layer(layer_state)) { @@ -54,5 +54,6 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { RGB_MATRIX_INDICATOR_SET_COLOR(59, 128, 128, 128); break; } + return false; } #endif diff --git a/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/ipetepete/keymap.c b/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/ipetepete/keymap.c index 93a90f12b0..9979b7baa3 100644 --- a/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/ipetepete/keymap.c +++ b/keyboards/kprepublic/bm60hsrgb_poker/rev1/keymaps/ipetepete/keymap.c @@ -1,18 +1,18 @@ /* Copyright 2020 ipetepete - * - * 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/>. - */ + * + * 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 QMK_KEYBOARD_H enum layers { @@ -117,7 +117,7 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { } -void rgb_matrix_indicators_kb(void) +bool rgb_matrix_indicators_user(void) { if (!g_suspend_state && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { @@ -141,4 +141,5 @@ void rgb_matrix_indicators_kb(void) break; } } + return false; } diff --git a/keyboards/kprepublic/bm60hsrgb_poker/rev2/rev2.c b/keyboards/kprepublic/bm60hsrgb_poker/rev2/rev2.c index 7da219eec2..a9c5508236 100644 --- a/keyboards/kprepublic/bm60hsrgb_poker/rev2/rev2.c +++ b/keyboards/kprepublic/bm60hsrgb_poker/rev2/rev2.c @@ -127,11 +127,14 @@ led_config_t g_led_config = { } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(28, 0xFF, 0xFF, 0xFF); } + return true; } // clang-format on diff --git a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c index 18986c604c..557be513ad 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/keymaps/p4yne/keymap.c @@ -266,19 +266,19 @@ void set_led_color_by_hsv(int ledkey, uint8_t h_in, uint8_t s_in, uint8_t v_in){ void set_led_color_by_layer(int layer, int ledkey){ set_led_color_by_hsv(ledkey, pgm_read_byte(&ledmap[layer][0]), pgm_read_byte(&ledmap[layer][1]), - pgm_read_byte(&ledmap[layer][2])); + pgm_read_byte(&ledmap[layer][2])); } void set_ledkey_by_layer_type(int layer, int ledkey, uint16_t key){ if (rgb_matrix_get_flags() != LED_FLAG_ALL){ if ( key == KC_TRNS ) { if ((pgm_read_byte(&ledmap[layer][3]) == LYR_TRANS) && (layer > 0)){ - // this key is transparent and the layer below does something + // this key is transparent and the layer below does something // - light it up in (lower) layer-1 specific color - set_led_color_by_layer(layer-1, ledkey); - } + set_led_color_by_layer(layer-1, ledkey); + } if (pgm_read_byte(&ledmap[layer][3]) == LYR_BLACK){ - // this key is transparent but the lower layer is not intended + // this key is transparent but the lower layer is not intended // to be used, it still works but not intended; type BLACK set_led_color_by_hsv(ledkey, HSV_BLACK); } @@ -300,7 +300,7 @@ void set_caps_lock(int layer) { // it might be used for displaying led pattern if((rgb_matrix_get_flags() != LED_FLAG_ALL)) { // or to keep the correct lighting on for the layer that use all keys - // on all other layers turn the led off, so only switch it of when + // on all other layers turn the led off, so only switch it of when // layer is BLACK if(pgm_read_byte(&ledmap[layer][3]) == LYR_BLACK){ set_led_color_by_hsv(caps_lock_led, HSV_BLACK); @@ -316,14 +316,14 @@ void set_layer_color(int layer) { uint8_t row = keyindex/MATRIX_COLS; uint8_t col = (keyindex-(keyindex/MATRIX_COLS)*MATRIX_COLS); uint16_t key=pgm_read_word(&keymaps[layer][row][col]); - + // continue if this is not a valid key if (key==KC_NO) { continue; } - + // handle layer specific coloring set_ledkey_by_layer_type(layer, ledkey, key); /* === below this function add custom overriding ledkey lighting === */ - + // gaming layer with highlighted keys //if (IS_LAYER_ON(_LVL4_)) { if (layer == _LVL4_) { @@ -439,10 +439,11 @@ void set_layer_color(int layer) { return; } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { int layer = get_highest_layer(layer_state); set_layer_color(layer); set_caps_lock(layer); + return false; } #ifdef LEADER_ENABLE diff --git a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c index 680f79a668..5563816ff3 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/rev1/keymaps/deadolus/keymap.c @@ -249,9 +249,10 @@ void set_layer_color(int layer) { return; } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { set_layer_color(get_highest_layer(layer_state)); + return false; } #ifdef LEADER_ENABLE diff --git a/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c index 6e0fd57117..0b2a8f7042 100644 --- a/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c +++ b/keyboards/kprepublic/bm65hsrgb_iso/rev1/rev1.c @@ -54,10 +54,13 @@ led_config_t g_led_config = { { 2, 2, 2, 2, 2, 2 } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } + return true; } #endif diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c index 0ac5d0c932..a9bf663c19 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c +++ b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c @@ -288,7 +288,7 @@ void set_layer_color(int layer) { } } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { led_t host_leds = host_keyboard_led_state(); if (host_leds.caps_lock) { @@ -300,4 +300,5 @@ void rgb_matrix_indicators_user(void) { } set_layer_color(get_highest_layer(layer_state)); + return false; } diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c index 4634a662b6..78f4a15818 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c +++ b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c @@ -43,10 +43,13 @@ led_config_t g_led_config = { { } }; //CAPS backlight -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } + return true; } #endif diff --git a/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c b/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c index 2fb7a6e9bf..4a13d037d6 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c +++ b/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c @@ -113,12 +113,13 @@ led_config_t g_led_config = { { } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) -{ - if (host_keyboard_led_state().caps_lock) - { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } + return true; } #endif diff --git a/keyboards/kprepublic/bm80v2/bm80v2.c b/keyboards/kprepublic/bm80v2/bm80v2.c index dd89c1b0f0..7de8c558c7 100644 --- a/keyboards/kprepublic/bm80v2/bm80v2.c +++ b/keyboards/kprepublic/bm80v2/bm80v2.c @@ -18,11 +18,11 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS6_SW1, CS5_SW1, CS4_SW1}, - {0, CS6_SW3, CS5_SW3, CS4_SW3}, - {0, CS6_SW4, CS5_SW4, CS4_SW4}, + {0, CS6_SW3, CS5_SW3, CS4_SW3}, + {0, CS6_SW4, CS5_SW4, CS4_SW4}, {0, CS6_SW5, CS5_SW5, CS4_SW5}, {0, CS6_SW6, CS5_SW6, CS4_SW6}, - {0, CS6_SW7, CS5_SW7, CS4_SW7}, + {0, CS6_SW7, CS5_SW7, CS4_SW7}, {0, CS6_SW8, CS5_SW8, CS4_SW8}, {0, CS6_SW9, CS5_SW9, CS4_SW9}, {0, CS21_SW1, CS20_SW1, CS19_SW1}, @@ -34,8 +34,8 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS21_SW7, CS20_SW7, CS19_SW7}, {0, CS21_SW8, CS20_SW8, CS19_SW8}, - - {0, CS9_SW1, CS8_SW1, CS7_SW1}, + + {0, CS9_SW1, CS8_SW1, CS7_SW1}, {0, CS9_SW2, CS8_SW2, CS7_SW2}, {0, CS9_SW3, CS8_SW3, CS7_SW3}, {0, CS9_SW4, CS8_SW4, CS7_SW4}, @@ -44,7 +44,7 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS9_SW7, CS8_SW7, CS7_SW7}, {0, CS9_SW8, CS8_SW8, CS7_SW8}, {0, CS9_SW9, CS8_SW9, CS7_SW9}, - {0,CS24_SW1, CS23_SW1, CS22_SW1}, + {0,CS24_SW1, CS23_SW1, CS22_SW1}, {0,CS24_SW2, CS23_SW2, CS22_SW2}, {0,CS24_SW3, CS23_SW3, CS22_SW3}, {0,CS24_SW4, CS23_SW4, CS22_SW4}, @@ -52,45 +52,45 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0,CS24_SW6, CS23_SW6, CS22_SW6}, {0,CS24_SW7, CS23_SW7, CS22_SW7}, {0,CS24_SW8, CS23_SW8, CS22_SW8}, - - {0, CS12_SW1, CS11_SW1, CS10_SW1}, - {0, CS12_SW2, CS11_SW2, CS10_SW2}, - {0, CS12_SW3, CS11_SW3, CS10_SW3}, - {0, CS12_SW4, CS11_SW4, CS10_SW4}, - {0, CS12_SW5, CS11_SW5, CS10_SW5}, - {0, CS12_SW6, CS11_SW6, CS10_SW6}, - {0, CS12_SW7, CS11_SW7, CS10_SW7}, + + {0, CS12_SW1, CS11_SW1, CS10_SW1}, + {0, CS12_SW2, CS11_SW2, CS10_SW2}, + {0, CS12_SW3, CS11_SW3, CS10_SW3}, + {0, CS12_SW4, CS11_SW4, CS10_SW4}, + {0, CS12_SW5, CS11_SW5, CS10_SW5}, + {0, CS12_SW6, CS11_SW6, CS10_SW6}, + {0, CS12_SW7, CS11_SW7, CS10_SW7}, {0, CS12_SW8, CS11_SW8, CS10_SW8}, {0, CS12_SW9, CS11_SW9, CS10_SW9}, - {0, CS27_SW1, CS26_SW1, CS25_SW1}, - {0, CS27_SW2, CS26_SW2, CS25_SW2}, - {0, CS27_SW3, CS26_SW3, CS25_SW3}, + {0, CS27_SW1, CS26_SW1, CS25_SW1}, + {0, CS27_SW2, CS26_SW2, CS25_SW2}, + {0, CS27_SW3, CS26_SW3, CS25_SW3}, {0, CS27_SW4, CS26_SW4, CS25_SW4}, {0, CS27_SW5, CS26_SW5, CS25_SW5}, - {0, CS27_SW6, CS26_SW6, CS25_SW6}, + {0, CS27_SW6, CS26_SW6, CS25_SW6}, {0, CS27_SW7, CS26_SW7, CS25_SW7}, {0, CS27_SW8, CS26_SW8, CS25_SW8}, - + {0, CS15_SW1, CS14_SW1, CS13_SW1}, {0, CS15_SW2, CS14_SW2, CS13_SW2}, - {0, CS15_SW3, CS14_SW3, CS13_SW3}, - {0, CS15_SW4, CS14_SW4, CS13_SW4}, - {0, CS15_SW5, CS14_SW5, CS13_SW5}, - {0, CS15_SW6, CS14_SW6, CS13_SW6}, - {0, CS15_SW7, CS14_SW7, CS13_SW7}, + {0, CS15_SW3, CS14_SW3, CS13_SW3}, + {0, CS15_SW4, CS14_SW4, CS13_SW4}, + {0, CS15_SW5, CS14_SW5, CS13_SW5}, + {0, CS15_SW6, CS14_SW6, CS13_SW6}, + {0, CS15_SW7, CS14_SW7, CS13_SW7}, {0, CS15_SW8, CS14_SW8, CS13_SW8}, {0, CS15_SW9, CS14_SW9, CS13_SW9}, {0, CS30_SW1, CS29_SW1, CS28_SW1}, {0, CS30_SW2, CS29_SW2, CS28_SW2}, {0, CS30_SW3, CS29_SW3, CS28_SW3}, {0, CS30_SW4, CS29_SW4, CS28_SW4}, - + {0, CS18_SW1, CS17_SW1, CS16_SW1}, - {0, CS18_SW3, CS17_SW3, CS16_SW3}, - {0, CS18_SW4, CS17_SW4, CS16_SW4}, - {0, CS18_SW5, CS17_SW5, CS16_SW5}, - {0, CS18_SW6, CS17_SW6, CS16_SW6}, - {0, CS18_SW7, CS17_SW7, CS16_SW7}, + {0, CS18_SW3, CS17_SW3, CS16_SW3}, + {0, CS18_SW4, CS17_SW4, CS16_SW4}, + {0, CS18_SW5, CS17_SW5, CS16_SW5}, + {0, CS18_SW6, CS17_SW6, CS16_SW6}, + {0, CS18_SW7, CS17_SW7, CS16_SW7}, {0, CS18_SW8, CS17_SW8, CS16_SW8}, {0, CS18_SW9, CS17_SW9, CS16_SW9}, {0, CS33_SW1, CS32_SW1, CS31_SW1}, @@ -101,16 +101,16 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS3_SW1, CS2_SW1, CS1_SW1}, {0, CS3_SW2, CS2_SW2, CS1_SW2}, - {0, CS3_SW3, CS2_SW3, CS1_SW3}, - {0, CS3_SW6, CS2_SW6, CS1_SW6}, + {0, CS3_SW3, CS2_SW3, CS1_SW3}, + {0, CS3_SW6, CS2_SW6, CS1_SW6}, {0, CS36_SW2, CS35_SW2, CS34_SW2}, {0, CS36_SW3, CS35_SW3, CS34_SW3}, {0, CS36_SW4, CS35_SW4, CS34_SW4}, {0, CS36_SW5, CS35_SW5, CS34_SW5}, {0, CS36_SW6, CS35_SW6, CS34_SW6}, {0, CS36_SW7, CS35_SW7, CS34_SW7}, - {0, CS36_SW8, CS35_SW8, CS34_SW8} - + {0, CS36_SW8, CS35_SW8, CS34_SW8} + }; led_config_t g_led_config = { { { 0, NO_LED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, @@ -133,17 +133,17 @@ led_config_t g_led_config = { { 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 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, 1, 1, - 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1 } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) -{ - if (host_keyboard_led_state().caps_lock) - { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); } + return true; } #endif - diff --git a/keyboards/kprepublic/bm80v2_iso/bm80v2_iso.c b/keyboards/kprepublic/bm80v2_iso/bm80v2_iso.c index 8c6eaf5a5b..e73cffd108 100644 --- a/keyboards/kprepublic/bm80v2_iso/bm80v2_iso.c +++ b/keyboards/kprepublic/bm80v2_iso/bm80v2_iso.c @@ -18,11 +18,11 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS6_SW1, CS5_SW1, CS4_SW1}, - {0, CS6_SW3, CS5_SW3, CS4_SW3}, - {0, CS6_SW4, CS5_SW4, CS4_SW4}, + {0, CS6_SW3, CS5_SW3, CS4_SW3}, + {0, CS6_SW4, CS5_SW4, CS4_SW4}, {0, CS6_SW5, CS5_SW5, CS4_SW5}, {0, CS6_SW6, CS5_SW6, CS4_SW6}, - {0, CS6_SW7, CS5_SW7, CS4_SW7}, + {0, CS6_SW7, CS5_SW7, CS4_SW7}, {0, CS6_SW8, CS5_SW8, CS4_SW8}, {0, CS6_SW9, CS5_SW9, CS4_SW9}, {0, CS21_SW1, CS20_SW1, CS19_SW1}, @@ -34,8 +34,8 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS21_SW7, CS20_SW7, CS19_SW7}, {0, CS21_SW8, CS20_SW8, CS19_SW8}, - - {0, CS9_SW1, CS8_SW1, CS7_SW1}, + + {0, CS9_SW1, CS8_SW1, CS7_SW1}, {0, CS9_SW2, CS8_SW2, CS7_SW2}, {0, CS9_SW3, CS8_SW3, CS7_SW3}, {0, CS9_SW4, CS8_SW4, CS7_SW4}, @@ -44,7 +44,7 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS9_SW7, CS8_SW7, CS7_SW7}, {0, CS9_SW8, CS8_SW8, CS7_SW8}, {0, CS9_SW9, CS8_SW9, CS7_SW9}, - {0,CS24_SW1, CS23_SW1, CS22_SW1}, + {0,CS24_SW1, CS23_SW1, CS22_SW1}, {0,CS24_SW2, CS23_SW2, CS22_SW2}, {0,CS24_SW3, CS23_SW3, CS22_SW3}, {0,CS24_SW4, CS23_SW4, CS22_SW4}, @@ -52,46 +52,46 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0,CS24_SW6, CS23_SW6, CS22_SW6}, {0,CS24_SW7, CS23_SW7, CS22_SW7}, {0,CS24_SW8, CS23_SW8, CS22_SW8}, - - {0, CS12_SW1, CS11_SW1, CS10_SW1}, - {0, CS12_SW2, CS11_SW2, CS10_SW2}, - {0, CS12_SW3, CS11_SW3, CS10_SW3}, - {0, CS12_SW4, CS11_SW4, CS10_SW4}, - {0, CS12_SW5, CS11_SW5, CS10_SW5}, - {0, CS12_SW6, CS11_SW6, CS10_SW6}, - {0, CS12_SW7, CS11_SW7, CS10_SW7}, + + {0, CS12_SW1, CS11_SW1, CS10_SW1}, + {0, CS12_SW2, CS11_SW2, CS10_SW2}, + {0, CS12_SW3, CS11_SW3, CS10_SW3}, + {0, CS12_SW4, CS11_SW4, CS10_SW4}, + {0, CS12_SW5, CS11_SW5, CS10_SW5}, + {0, CS12_SW6, CS11_SW6, CS10_SW6}, + {0, CS12_SW7, CS11_SW7, CS10_SW7}, {0, CS12_SW8, CS11_SW8, CS10_SW8}, {0, CS12_SW9, CS11_SW9, CS10_SW9}, - {0, CS27_SW1, CS26_SW1, CS25_SW1}, - {0, CS27_SW2, CS26_SW2, CS25_SW2}, - {0, CS27_SW3, CS26_SW3, CS25_SW3}, + {0, CS27_SW1, CS26_SW1, CS25_SW1}, + {0, CS27_SW2, CS26_SW2, CS25_SW2}, + {0, CS27_SW3, CS26_SW3, CS25_SW3}, {0, CS27_SW4, CS26_SW4, CS25_SW4}, {0, CS27_SW5, CS26_SW5, CS25_SW5}, - {0, CS27_SW6, CS26_SW6, CS25_SW6}, + {0, CS27_SW6, CS26_SW6, CS25_SW6}, {0, CS27_SW7, CS26_SW7, CS25_SW7}, {0, CS27_SW8, CS26_SW8, CS25_SW8}, - + {0, CS15_SW1, CS14_SW1, CS13_SW1}, {0, CS15_SW2, CS14_SW2, CS13_SW2}, - {0, CS15_SW3, CS14_SW3, CS13_SW3}, - {0, CS15_SW4, CS14_SW4, CS13_SW4}, - {0, CS15_SW5, CS14_SW5, CS13_SW5}, - {0, CS15_SW6, CS14_SW6, CS13_SW6}, - {0, CS15_SW7, CS14_SW7, CS13_SW7}, + {0, CS15_SW3, CS14_SW3, CS13_SW3}, + {0, CS15_SW4, CS14_SW4, CS13_SW4}, + {0, CS15_SW5, CS14_SW5, CS13_SW5}, + {0, CS15_SW6, CS14_SW6, CS13_SW6}, + {0, CS15_SW7, CS14_SW7, CS13_SW7}, {0, CS15_SW8, CS14_SW8, CS13_SW8}, {0, CS15_SW9, CS14_SW9, CS13_SW9}, {0, CS30_SW1, CS29_SW1, CS28_SW1}, {0, CS30_SW2, CS29_SW2, CS28_SW2}, {0, CS30_SW3, CS29_SW3, CS28_SW3}, {0, CS30_SW4, CS29_SW4, CS28_SW4}, - + {0, CS18_SW1, CS17_SW1, CS16_SW1}, {0, CS18_SW2, CS17_SW2, CS16_SW2}, - {0, CS18_SW3, CS17_SW3, CS16_SW3}, - {0, CS18_SW4, CS17_SW4, CS16_SW4}, - {0, CS18_SW5, CS17_SW5, CS16_SW5}, - {0, CS18_SW6, CS17_SW6, CS16_SW6}, - {0, CS18_SW7, CS17_SW7, CS16_SW7}, + {0, CS18_SW3, CS17_SW3, CS16_SW3}, + {0, CS18_SW4, CS17_SW4, CS16_SW4}, + {0, CS18_SW5, CS17_SW5, CS16_SW5}, + {0, CS18_SW6, CS17_SW6, CS16_SW6}, + {0, CS18_SW7, CS17_SW7, CS16_SW7}, {0, CS18_SW8, CS17_SW8, CS16_SW8}, {0, CS18_SW9, CS17_SW9, CS16_SW9}, {0, CS33_SW1, CS32_SW1, CS31_SW1}, @@ -102,16 +102,16 @@ const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS3_SW1, CS2_SW1, CS1_SW1}, {0, CS3_SW2, CS2_SW2, CS1_SW2}, - {0, CS3_SW3, CS2_SW3, CS1_SW3}, - {0, CS3_SW6, CS2_SW6, CS1_SW6}, + {0, CS3_SW3, CS2_SW3, CS1_SW3}, + {0, CS3_SW6, CS2_SW6, CS1_SW6}, {0, CS36_SW2, CS35_SW2, CS34_SW2}, {0, CS36_SW3, CS35_SW3, CS34_SW3}, {0, CS36_SW4, CS35_SW4, CS34_SW4}, {0, CS36_SW5, CS35_SW5, CS34_SW5}, {0, CS36_SW6, CS35_SW6, CS34_SW6}, {0, CS36_SW7, CS35_SW7, CS34_SW7}, - {0, CS36_SW8, CS35_SW8, CS34_SW8} - + {0, CS36_SW8, CS35_SW8, CS34_SW8} + }; led_config_t g_led_config = { { { 0, NO_LED, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, @@ -134,17 +134,17 @@ led_config_t g_led_config = { { 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, - 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1 } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) -{ - if (host_keyboard_led_state().caps_lock) - { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(50, 0xFF, 0xFF, 0xFF); } + return true; } #endif - diff --git a/keyboards/kprepublic/bm980hsrgb/keymaps/peepeetee/keymap.c b/keyboards/kprepublic/bm980hsrgb/keymaps/peepeetee/keymap.c index 80deedc7b5..5d9de5173c 100644 --- a/keyboards/kprepublic/bm980hsrgb/keymaps/peepeetee/keymap.c +++ b/keyboards/kprepublic/bm980hsrgb/keymaps/peepeetee/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { led_t host_leds = host_keyboard_led_state(); if (host_leds.num_lock) { @@ -58,4 +58,5 @@ void rgb_matrix_indicators_user(void) { } //set_layer_color(get_highest_layer(layer_state)); + return false; } |