From 70267b35c357f2744262300db03eafe642159734 Mon Sep 17 00:00:00 2001 From: Chris Cullin Date: Fri, 16 Jul 2021 07:52:05 +1000 Subject: Dual RGB Matrix IS31FL3737 driver support to address #13442 (#13457) * initial commit * removed changes to write_pwm_buffer * backward compatbility added * fixed issue with backward compatibility * documentation update * removed unneccessary comment. branched from master * updated per comments #13457 * removed blank line * cformat on diff files --- quantum/rgb_matrix/rgb_matrix_drivers.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'quantum') diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 6a11d4791e..dfdf452190 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -65,6 +65,9 @@ static void init(void) { # endif # elif defined(IS31FL3737) IS31FL3737_init(DRIVER_ADDR_1); +# if defined(DRIVER_ADDR_2) && (DRIVER_ADDR_2 != DRIVER_ADDR_1) // provides backward compatibility + IS31FL3737_init(DRIVER_ADDR_2); +# endif # else IS31FL3741_init(DRIVER_ADDR_1); # endif @@ -105,7 +108,10 @@ static void init(void) { IS31FL3733_update_led_control_registers(DRIVER_ADDR_4, 3); # endif # elif defined(IS31FL3737) - IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, DRIVER_ADDR_2); + IS31FL3737_update_led_control_registers(DRIVER_ADDR_1, 0); +# if defined(DRIVER_ADDR_2) && (DRIVER_ADDR_2 != DRIVER_ADDR_1) // provides backward compatibility + IS31FL3737_update_led_control_registers(DRIVER_ADDR_2, 1); +# endif # else IS31FL3741_update_led_control_registers(DRIVER_ADDR_1, 0); # endif @@ -152,7 +158,12 @@ const rgb_matrix_driver_t rgb_matrix_driver = { .set_color_all = IS31FL3733_set_color_all, }; # elif defined(IS31FL3737) -static void flush(void) { IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2); } +static void flush(void) { + IS31FL3737_update_pwm_buffers(DRIVER_ADDR_1, 0); +# if defined(DRIVER_ADDR_2) && (DRIVER_ADDR_2 != DRIVER_ADDR_1) // provides backward compatibility + IS31FL3737_update_pwm_buffers(DRIVER_ADDR_2, 1); +# endif +} const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, -- cgit v1.2.3