From 64b1ed45507a15d5594b1f90b936c2096918f5a4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 4 Oct 2022 15:24:22 -0700 Subject: Fix Per Key LED Indicator Callbacks (#18450) Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com> Co-authored-by: Nick Brassel --- .../massdrop/ctrl/keymaps/xanimos/config_led.c | 31 ++++++++++---------- keyboards/massdrop/ctrl/keymaps/xanimos/keymap.c | 33 +++++++++++----------- 2 files changed, 33 insertions(+), 31 deletions(-) (limited to 'keyboards/massdrop/ctrl/keymaps/xanimos') diff --git a/keyboards/massdrop/ctrl/keymaps/xanimos/config_led.c b/keyboards/massdrop/ctrl/keymaps/xanimos/config_led.c index 650b31477c..d83318de83 100644 --- a/keyboards/massdrop/ctrl/keymaps/xanimos/config_led.c +++ b/keyboards/massdrop/ctrl/keymaps/xanimos/config_led.c @@ -1,18 +1,18 @@ /* Copyright 2022 Daniel Weeks (@xanimos) - * - * 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 . - */ + * + * 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 . + */ #ifdef RGB_MATRIX_ENABLE #include "ctrl.h" @@ -89,8 +89,9 @@ led_config_t g_led_config = { { #ifdef USB_LED_INDICATOR_ENABLE -void rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { +bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { md_rgb_matrix_indicators_advanced(led_min, led_max); + return rgb_matrix_indicators_advanced_user(led_min, led_max); } #endif // USB_LED_INDICATOR_ENABLE diff --git a/keyboards/massdrop/ctrl/keymaps/xanimos/keymap.c b/keyboards/massdrop/ctrl/keymaps/xanimos/keymap.c index 2b6515fc97..561171a04a 100644 --- a/keyboards/massdrop/ctrl/keymaps/xanimos/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/xanimos/keymap.c @@ -1,18 +1,18 @@ /* Copyright 2022 Daniel Weeks (@xanimos) - * - * 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 . - */ + * + * 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 . + */ #include "keymap.h" @@ -334,7 +334,7 @@ void set_layer_color(int layer) { float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b); continue; - } + } if(layer == _FL && i <= 4 && i >= 1) { continue; // Leave RGB for F1-F4 of function layer to adjust RGB settings } @@ -343,13 +343,14 @@ void set_layer_color(int layer) { } } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { if (disable_layer_color || rgb_matrix_get_flags() == LED_FLAG_NONE || rgb_matrix_get_flags() == LED_FLAG_UNDERGLOW) { return; } set_layer_color(get_highest_layer(layer_state)); + return false; } -- cgit v1.2.3