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 /users | |
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 'users')
-rw-r--r-- | users/bbaserdem/bb-rgb.c | 15 | ||||
-rw-r--r-- | users/bbaserdem/bb-rgb.h | 2 | ||||
-rw-r--r-- | users/curry/rgb_matrix_user.c | 3 | ||||
-rw-r--r-- | users/drashna/rgb/rgb_matrix_stuff.c | 9 |
4 files changed, 12 insertions, 17 deletions
diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index bdb7f12bbd..49b91129ba 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -23,7 +23,7 @@ // Allow hooking into the RGB matrix indications using keymap code -// Modulates the brightness of indicator +// Modulates the brightness of indicator RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { RGB output; output.r = r / 2; @@ -63,12 +63,12 @@ __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_mi return false; } // Set RGB state depending on layer -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) { uint8_t thisInd = 3; RGB thisCol; // Load keymap hooks if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; + return false; } // Grab color info switch (get_highest_layer(layer_state)) { @@ -110,6 +110,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { break; } helper_painter(led_min, led_max, thisCol, thisInd); + return false; } // Hook into shutdown code to make all perkey LED's red on hitting reset @@ -120,11 +121,3 @@ void shutdown_rgb(void) { // Delay until this registers while(timer_elapsed(timer_start) < 250) {wait_ms(1);} } - -// Hook into suspend code -void suspend_power_down_rgb(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_rgb(void) { - rgb_matrix_set_suspend_state(false); -} diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index 62b6da9f2f..3e96b997fe 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -21,7 +21,7 @@ */ // For custom indicators -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); // Hook into shutdown code void shutdown_rgb(void); void suspend_wakeup_init_rgb(void); diff --git a/users/curry/rgb_matrix_user.c b/users/curry/rgb_matrix_user.c index 053226ab60..3c2008aa01 100644 --- a/users/curry/rgb_matrix_user.c +++ b/users/curry/rgb_matrix_user.c @@ -36,7 +36,7 @@ void check_default_layer(uint8_t mode, uint8_t type) { } } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { if (userspace_config.rgb_layer_change && rgb_matrix_config.enable) { switch (get_highest_layer(layer_state)) { case _RAISE: @@ -55,6 +55,7 @@ void rgb_matrix_indicators_user(void) { } check_default_layer(0, LED_FLAG_MODIFIER); } + return false; } bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c index 64549d8fae..2867641a3e 100644 --- a/users/drashna/rgb/rgb_matrix_stuff.c +++ b/users/drashna/rgb/rgb_matrix_stuff.c @@ -91,9 +91,9 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { __attribute__((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { return true; } -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 (!rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { - return; + return false; } #if defined(RGBLIGHT_ENABLE) @@ -140,11 +140,12 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { break; } } + return false; } __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { return true; } -void rgb_matrix_indicators_user(void) { - rgb_matrix_indicators_keymap(); +bool rgb_matrix_indicators_user(void) { + return rgb_matrix_indicators_keymap(); } |