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 --- quantum/led_matrix/led_matrix.c | 16 ++++++++++++---- quantum/led_matrix/led_matrix.h | 8 ++++---- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'quantum/led_matrix') diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index c26b1ad19b..e215c2c2c3 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c @@ -385,9 +385,13 @@ void led_matrix_indicators(void) { led_matrix_indicators_user(); } -__attribute__((weak)) void led_matrix_indicators_kb(void) {} +__attribute__((weak)) bool led_matrix_indicators_kb(void) { + return led_matrix_indicators_user(); +} -__attribute__((weak)) void led_matrix_indicators_user(void) {} +__attribute__((weak)) bool led_matrix_indicators_user(void) { + return true; +} void led_matrix_indicators_advanced(effect_params_t *params) { /* special handling is needed for "params->iter", since it's already been incremented. @@ -407,9 +411,13 @@ void led_matrix_indicators_advanced(effect_params_t *params) { led_matrix_indicators_advanced_user(min, max); } -__attribute__((weak)) void led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) { + return led_matrix_indicators_advanced_user(led_min, led_max); +} -__attribute__((weak)) void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {} +__attribute__((weak)) bool led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + return true; +} void led_matrix_init(void) { led_matrix_driver.init(); diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index db4f223d5b..c7d360f366 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h @@ -120,12 +120,12 @@ void led_matrix_task(void); // This runs after another backlight effect and replaces // values already set void led_matrix_indicators(void); -void led_matrix_indicators_kb(void); -void led_matrix_indicators_user(void); +bool led_matrix_indicators_kb(void); +bool led_matrix_indicators_user(void); void led_matrix_indicators_advanced(effect_params_t *params); -void led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); -void led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); +bool led_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max); +bool led_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); void led_matrix_init(void); -- cgit v1.2.3