From 8711dda0d31cae8719ca5fa20729cc877e1dee3c Mon Sep 17 00:00:00 2001 From: cmdremily <68452184+cmdremily@users.noreply.github.com> Date: Sat, 12 Sep 2020 22:32:28 +0200 Subject: [PATCH 1/2] Allow the use of a single IS31FL3731 LED driver --- quantum/rgb_matrix_drivers.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 0403d6c96a..8f670f9a33 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c @@ -31,7 +31,9 @@ static void init(void) { i2c_init(); # ifdef IS31FL3731 IS31FL3731_init(DRIVER_ADDR_1); +# ifdef DRIVER_ADDR_2 IS31FL3731_init(DRIVER_ADDR_2); +# endif # elif defined(IS31FL3733) IS31FL3733_init(DRIVER_ADDR_1, 0); # elif defined(IS31FL3737) @@ -55,7 +57,9 @@ static void init(void) { // This actually updates the LED drivers # ifdef IS31FL3731 IS31FL3731_update_led_control_registers(DRIVER_ADDR_1, 0); +# ifdef DRIVER_ADDR_2 IS31FL3731_update_led_control_registers(DRIVER_ADDR_2, 1); +# endif # elif defined(IS31FL3733) IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0); IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1); @@ -69,7 +73,9 @@ static void init(void) { # ifdef IS31FL3731 static void flush(void) { IS31FL3731_update_pwm_buffers(DRIVER_ADDR_1, 0); +# ifdef DRIVER_ADDR_2 IS31FL3731_update_pwm_buffers(DRIVER_ADDR_2, 1); +# endif } const rgb_matrix_driver_t rgb_matrix_driver = { From ef7c79b781318faaef4e6fe318fffade1b1ed299 Mon Sep 17 00:00:00 2001 From: cmdremily <68452184+cmdremily@users.noreply.github.com> Date: Sat, 12 Sep 2020 22:32:46 +0200 Subject: [PATCH 2/2] Fix issues with unused variables and functions preventing a clean compile. --- quantum/process_keycode/process_rgb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quantum/process_keycode/process_rgb.c b/quantum/process_keycode/process_rgb.c index a1e46e0348..d38af74f41 100644 --- a/quantum/process_keycode/process_rgb.c +++ b/quantum/process_keycode/process_rgb.c @@ -23,6 +23,7 @@ typedef void (*rgb_func_pointer)(void); * * noinline to optimise for firmware size not speed (not in hot path) */ +#if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)) static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, const rgb_func_pointer inc_func, const rgb_func_pointer dec_func) { if (is_shifted) { dec_func(); @@ -30,6 +31,7 @@ static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, inc_func(); } } +#endif /** * Wrapper for animation mode @@ -56,7 +58,9 @@ bool process_rgb(const uint16_t keycode, const keyrecord_t *record) { // Split keyboards need to trigger on key-up for edge-case issue if (!record->event.pressed) { #endif +#if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)) uint8_t shifted = get_mods() & MOD_MASK_SHIFT; +#endif switch (keycode) { case RGB_TOG: #if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)