From fd1c1520f69d67feb7eee703f2a76db30b150992 Mon Sep 17 00:00:00 2001 From: jack <0x6A73@pm.me> Date: Sun, 20 Nov 2022 14:30:40 +0000 Subject: [PATCH] Fixup keychron/q5 (#19119) --- keyboards/keychron/q5/ansi/ansi.c | 2 +- keyboards/keychron/q5/ansi/config.h | 2 +- keyboards/keychron/q5/ansi_encoder/ansi_encoder.c | 2 +- keyboards/keychron/q5/ansi_encoder/config.h | 2 +- keyboards/keychron/q5/iso/config.h | 2 +- keyboards/keychron/q5/iso/iso.c | 2 +- keyboards/keychron/q5/iso_encoder/config.h | 2 +- keyboards/keychron/q5/iso_encoder/iso_encoder.c | 2 +- keyboards/keychron/q5/q5.c | 4 +++- 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/keyboards/keychron/q5/ansi/ansi.c b/keyboards/keychron/q5/ansi/ansi.c index 8efed462f79c..6aeb46c07d49 100644 --- a/keyboards/keychron/q5/ansi/ansi.c +++ b/keyboards/keychron/q5/ansi/ansi.c @@ -18,7 +18,7 @@ #ifdef RGB_MATRIX_ENABLE -const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/keychron/q5/ansi/config.h b/keyboards/keychron/q5/ansi/config.h index 55e4ec41ca3d..9ed58dd52275 100644 --- a/keyboards/keychron/q5/ansi/config.h +++ b/keyboards/keychron/q5/ansi/config.h @@ -19,7 +19,7 @@ /* RGB Matrix Configuration */ #define DRIVER_1_LED_TOTAL 55 #define DRIVER_2_LED_TOTAL 45 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) /* Enable caps-lock LED */ #define CAPS_LOCK_LED_INDEX 54 diff --git a/keyboards/keychron/q5/ansi_encoder/ansi_encoder.c b/keyboards/keychron/q5/ansi_encoder/ansi_encoder.c index 1f11ae414300..43c27433b2e8 100644 --- a/keyboards/keychron/q5/ansi_encoder/ansi_encoder.c +++ b/keyboards/keychron/q5/ansi_encoder/ansi_encoder.c @@ -20,7 +20,7 @@ // clang-format off -const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/keychron/q5/ansi_encoder/config.h b/keyboards/keychron/q5/ansi_encoder/config.h index b96104d0c000..6aecac619e07 100644 --- a/keyboards/keychron/q5/ansi_encoder/config.h +++ b/keyboards/keychron/q5/ansi_encoder/config.h @@ -19,7 +19,7 @@ /* RGB Matrix Configuration */ #define DRIVER_1_LED_TOTAL 53 #define DRIVER_2_LED_TOTAL 45 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) /* Encoder Configuration */ #define ENCODERS_PAD_A { C14 } diff --git a/keyboards/keychron/q5/iso/config.h b/keyboards/keychron/q5/iso/config.h index 751a45711f3b..df775f11f1f8 100644 --- a/keyboards/keychron/q5/iso/config.h +++ b/keyboards/keychron/q5/iso/config.h @@ -19,7 +19,7 @@ /* RGB Matrix Configuration */ #define DRIVER_1_LED_TOTAL 55 #define DRIVER_2_LED_TOTAL 46 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) /* Enable caps-lock LED */ #define CAPS_LOCK_LED_INDEX 53 diff --git a/keyboards/keychron/q5/iso/iso.c b/keyboards/keychron/q5/iso/iso.c index 221dd7b78a82..b57474f5352f 100644 --- a/keyboards/keychron/q5/iso/iso.c +++ b/keyboards/keychron/q5/iso/iso.c @@ -20,7 +20,7 @@ // clang-format off -const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/keychron/q5/iso_encoder/config.h b/keyboards/keychron/q5/iso_encoder/config.h index 58cda9478119..3c9eee8d494a 100644 --- a/keyboards/keychron/q5/iso_encoder/config.h +++ b/keyboards/keychron/q5/iso_encoder/config.h @@ -19,7 +19,7 @@ /* RGB Matrix Configuration */ #define DRIVER_1_LED_TOTAL 53 #define DRIVER_2_LED_TOTAL 46 -#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) +#define RGB_MATRIX_LED_COUNT (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) /* Encoder Configuration */ #define ENCODERS_PAD_A { C14 } diff --git a/keyboards/keychron/q5/iso_encoder/iso_encoder.c b/keyboards/keychron/q5/iso_encoder/iso_encoder.c index 75387ad4b661..8ae11bc36b44 100644 --- a/keyboards/keychron/q5/iso_encoder/iso_encoder.c +++ b/keyboards/keychron/q5/iso_encoder/iso_encoder.c @@ -20,7 +20,7 @@ // clang-format off -const ckled2001_led PROGMEM g_ckled2001_leds[DRIVER_LED_TOTAL] = { +const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/keychron/q5/q5.c b/keyboards/keychron/q5/q5.c index d1127d190898..f1ccf482149b 100644 --- a/keyboards/keychron/q5/q5.c +++ b/keyboards/keychron/q5/q5.c @@ -69,7 +69,8 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__((weak)) 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_user(led_min, led_max)) { return false; } // RGB_MATRIX_INDICATOR_SET_COLOR(index, red, green, blue); # if defined(CAPS_LOCK_LED_INDEX) if (host_keyboard_led_state().caps_lock) { @@ -89,6 +90,7 @@ __attribute__((weak)) void rgb_matrix_indicators_advanced_user(uint8_t led_min, } } # endif // NUM_LOCK_LED_INDEX + return true; } #endif // RGB_MATRIX_ENABLE...