diff --git a/drivers/led/aw20216s.c b/drivers/led/aw20216s.c index 078a694d30f..988cb6e9f6a 100644 --- a/drivers/led/aw20216s.c +++ b/drivers/led/aw20216s.c @@ -166,3 +166,10 @@ void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index) { } g_pwm_buffer_update_required[index] = false; } + +void aw20216s_flush(void) { + aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0); +#if defined(AW20216S_CS_PIN_2) + aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1); +#endif +} diff --git a/drivers/led/aw20216s.h b/drivers/led/aw20216s.h index f8c0efcc6f9..8abc2ee4af8 100644 --- a/drivers/led/aw20216s.h +++ b/drivers/led/aw20216s.h @@ -68,6 +68,8 @@ void aw20216s_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); void aw20216s_set_color_all(uint8_t red, uint8_t green, uint8_t blue); void aw20216s_update_pwm_buffers(pin_t cs_pin, uint8_t index); +void aw20216s_flush(void); + #define CS1_SW1 0x00 #define CS2_SW1 0x01 #define CS3_SW1 0x02 diff --git a/drivers/led/issi/is31fl3731-simple.c b/drivers/led/issi/is31fl3731-simple.c index f9ad703ced8..adf2ccfca09 100644 --- a/drivers/led/issi/is31fl3731-simple.c +++ b/drivers/led/issi/is31fl3731-simple.c @@ -211,3 +211,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3731_flush(void) { + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); +#if defined(IS31FL3731_I2C_ADDRESS_2) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); +# if defined(IS31FL3731_I2C_ADDRESS_3) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2); +# if defined(IS31FL3731_I2C_ADDRESS_4) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3731-simple.h b/drivers/led/issi/is31fl3731-simple.h index 3233fdc0d75..69d38e74dac 100644 --- a/drivers/led/issi/is31fl3731-simple.h +++ b/drivers/led/issi/is31fl3731-simple.h @@ -80,6 +80,8 @@ void is31fl3731_set_led_control_register(uint8_t index, bool value); void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3731_flush(void); + #define C1_1 0x24 #define C1_2 0x25 #define C1_3 0x26 diff --git a/drivers/led/issi/is31fl3731.c b/drivers/led/issi/is31fl3731.c index a30e8fcbc2b..767c0da0d90 100644 --- a/drivers/led/issi/is31fl3731.c +++ b/drivers/led/issi/is31fl3731.c @@ -223,3 +223,16 @@ void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index) { } g_led_control_registers_update_required[index] = false; } + +void is31fl3731_flush(void) { + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); +#if defined(IS31FL3731_I2C_ADDRESS_2) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); +# if defined(IS31FL3731_I2C_ADDRESS_3) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2); +# if defined(IS31FL3731_I2C_ADDRESS_4) + is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3731.h b/drivers/led/issi/is31fl3731.h index fff91bfdbfc..cab6d40c5a7 100644 --- a/drivers/led/issi/is31fl3731.h +++ b/drivers/led/issi/is31fl3731.h @@ -81,6 +81,8 @@ void is31fl3731_set_led_control_register(uint8_t index, bool red, bool green, bo void is31fl3731_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3731_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3731_flush(void); + #define C1_1 0x24 #define C1_2 0x25 #define C1_3 0x26 diff --git a/drivers/led/issi/is31fl3733-simple.c b/drivers/led/issi/is31fl3733-simple.c index e94b4c7d78b..dbbf86a8f54 100644 --- a/drivers/led/issi/is31fl3733-simple.c +++ b/drivers/led/issi/is31fl3733-simple.c @@ -233,3 +233,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3733_flush(void) { + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); +#if defined(IS31FL3733_I2C_ADDRESS_2) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); +# if defined(IS31FL3733_I2C_ADDRESS_3) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2); +# if defined(IS31FL3733_I2C_ADDRESS_4) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3733-simple.h b/drivers/led/issi/is31fl3733-simple.h index 8041a7f0f36..b8a4530260a 100644 --- a/drivers/led/issi/is31fl3733-simple.h +++ b/drivers/led/issi/is31fl3733-simple.h @@ -99,6 +99,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool value); void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3733_flush(void); + #define IS31FL3733_PUR_0R 0x00 // No PUR resistor #define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time diff --git a/drivers/led/issi/is31fl3733.c b/drivers/led/issi/is31fl3733.c index efc59295875..35ec96a55a9 100644 --- a/drivers/led/issi/is31fl3733.c +++ b/drivers/led/issi/is31fl3733.c @@ -248,3 +248,16 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3733_flush(void) { + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); +#if defined(IS31FL3733_I2C_ADDRESS_2) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); +# if defined(IS31FL3733_I2C_ADDRESS_3) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2); +# if defined(IS31FL3733_I2C_ADDRESS_4) + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3733.h b/drivers/led/issi/is31fl3733.h index e56d04f66fb..2a025769793 100644 --- a/drivers/led/issi/is31fl3733.h +++ b/drivers/led/issi/is31fl3733.h @@ -124,6 +124,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bo void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3733_flush(void); + #define IS31FL3733_PUR_0R 0x00 // No PUR resistor #define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time diff --git a/drivers/led/issi/is31fl3736-simple.c b/drivers/led/issi/is31fl3736-simple.c index f3f202efb2c..d8262c3416a 100644 --- a/drivers/led/issi/is31fl3736-simple.c +++ b/drivers/led/issi/is31fl3736-simple.c @@ -220,3 +220,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3736_flush(void) { + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0); +#if defined(IS31FL3736_I2C_ADDRESS_2) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1); +# if defined(IS31FL3736_I2C_ADDRESS_3) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2); +# if defined(IS31FL3736_I2C_ADDRESS_4) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3736-simple.h b/drivers/led/issi/is31fl3736-simple.h index d5525e460d9..4f9dee47b04 100644 --- a/drivers/led/issi/is31fl3736-simple.h +++ b/drivers/led/issi/is31fl3736-simple.h @@ -94,6 +94,8 @@ void is31fl3736_set_led_control_register(uint8_t index, bool value); void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3736_flush(void); + #define IS31FL3736_PUR_0R 0x00 // No PUR resistor #define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor diff --git a/drivers/led/issi/is31fl3736.c b/drivers/led/issi/is31fl3736.c index 03f50873dfd..4edf1b04c87 100644 --- a/drivers/led/issi/is31fl3736.c +++ b/drivers/led/issi/is31fl3736.c @@ -237,3 +237,16 @@ void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3736_flush(void) { + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0); +#if defined(IS31FL3736_I2C_ADDRESS_2) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1); +# if defined(IS31FL3736_I2C_ADDRESS_3) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2); +# if defined(IS31FL3736_I2C_ADDRESS_4) + is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3736.h b/drivers/led/issi/is31fl3736.h index 91312384ae1..cd3505b0b6c 100644 --- a/drivers/led/issi/is31fl3736.h +++ b/drivers/led/issi/is31fl3736.h @@ -108,6 +108,8 @@ void is31fl3736_set_led_control_register(uint8_t index, bool red, bool green, bo void is31fl3736_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3736_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3736_flush(void); + #define IS31FL3736_PUR_0R 0x00 // No PUR resistor #define IS31FL3736_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3736_PUR_1KR 0x02 // 1.0k Ohm resistor diff --git a/drivers/led/issi/is31fl3737-simple.c b/drivers/led/issi/is31fl3737-simple.c index 3db7b7ed338..7a4263d9aff 100644 --- a/drivers/led/issi/is31fl3737-simple.c +++ b/drivers/led/issi/is31fl3737-simple.c @@ -217,3 +217,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3737_flush(void) { + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0); +#if defined(IS31FL3737_I2C_ADDRESS_2) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1); +# if defined(IS31FL3737_I2C_ADDRESS_3) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2); +# if defined(IS31FL3737_I2C_ADDRESS_4) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3737-simple.h b/drivers/led/issi/is31fl3737-simple.h index 0f4e0d014b3..106127e737a 100644 --- a/drivers/led/issi/is31fl3737-simple.h +++ b/drivers/led/issi/is31fl3737-simple.h @@ -84,6 +84,8 @@ void is31fl3737_set_led_control_register(uint8_t index, bool value); void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3737_flush(void); + #define IS31FL3737_PUR_0R 0x00 // No PUR resistor #define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL #define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL diff --git a/drivers/led/issi/is31fl3737.c b/drivers/led/issi/is31fl3737.c index c2af75bbb8c..d769bb9707f 100644 --- a/drivers/led/issi/is31fl3737.c +++ b/drivers/led/issi/is31fl3737.c @@ -233,3 +233,16 @@ void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } } + +void is31fl3737_flush(void) { + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0); +#if defined(IS31FL3737_I2C_ADDRESS_2) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1); +# if defined(IS31FL3737_I2C_ADDRESS_3) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2); +# if defined(IS31FL3737_I2C_ADDRESS_4) + is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3737.h b/drivers/led/issi/is31fl3737.h index a2a81640f65..bb4afbcccb0 100644 --- a/drivers/led/issi/is31fl3737.h +++ b/drivers/led/issi/is31fl3737.h @@ -101,6 +101,8 @@ void is31fl3737_set_led_control_register(uint8_t index, bool red, bool green, bo void is31fl3737_update_pwm_buffers(uint8_t addr, uint8_t index); void is31fl3737_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3737_flush(void); + #define IS31FL3737_PUR_0R 0x00 // No PUR resistor #define IS31FL3737_PUR_05KR 0x01 // 0.5k Ohm resistor in t_NOL #define IS31FL3737_PUR_1KR 0x02 // 1.0k Ohm resistor in t_NOL diff --git a/drivers/led/issi/is31fl3741-simple.c b/drivers/led/issi/is31fl3741-simple.c index 93c02fbc26d..c7335866ec1 100644 --- a/drivers/led/issi/is31fl3741-simple.c +++ b/drivers/led/issi/is31fl3741-simple.c @@ -251,3 +251,16 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t valu g_scaling_registers_update_required[pled->driver] = true; } + +void is31fl3741_flush(void) { + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); +#if defined(IS31FL3741_I2C_ADDRESS_2) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1); +# if defined(IS31FL3741_I2C_ADDRESS_3) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2); +# if defined(IS31FL3741_I2C_ADDRESS_4) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3741-simple.h b/drivers/led/issi/is31fl3741-simple.h index 46c058c6445..29e6dc261d6 100644 --- a/drivers/led/issi/is31fl3741-simple.h +++ b/drivers/led/issi/is31fl3741-simple.h @@ -87,6 +87,8 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t valu void is31fl3741_set_pwm_buffer(const is31fl3741_led *pled, uint8_t value); +void is31fl3741_flush(void); + #define IS31FL3741_PUR_0R 0x00 // No PUR resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor diff --git a/drivers/led/issi/is31fl3741.c b/drivers/led/issi/is31fl3741.c index 47c15a11cae..5e4ed711ca6 100644 --- a/drivers/led/issi/is31fl3741.c +++ b/drivers/led/issi/is31fl3741.c @@ -269,3 +269,16 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, g_scaling_registers_update_required[pled->driver] = true; } + +void is31fl3741_flush(void) { + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); +#if defined(IS31FL3741_I2C_ADDRESS_2) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1); +# if defined(IS31FL3741_I2C_ADDRESS_3) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2); +# if defined(IS31FL3741_I2C_ADDRESS_4) + is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} diff --git a/drivers/led/issi/is31fl3741.h b/drivers/led/issi/is31fl3741.h index 30fab248bc9..aedbe89b93d 100644 --- a/drivers/led/issi/is31fl3741.h +++ b/drivers/led/issi/is31fl3741.h @@ -104,6 +104,8 @@ void is31fl3741_set_scaling_registers(const is31fl3741_led_t *pled, uint8_t red, void is31fl3741_set_pwm_buffer(const is31fl3741_led_t *pled, uint8_t red, uint8_t green, uint8_t blue); +void is31fl3741_flush(void); + #define IS31FL3741_PUR_0R 0x00 // No PUR resistor #define IS31FL3741_PUR_05KR 0x01 // 0.5k Ohm resistor #define IS31FL3741_PUR_1KR 0x02 // 1.0k Ohm resistor diff --git a/drivers/led/issi/is31flcommon.c b/drivers/led/issi/is31flcommon.c index 4b78947ada3..850f23c8312 100644 --- a/drivers/led/issi/is31flcommon.c +++ b/drivers/led/issi/is31flcommon.c @@ -174,6 +174,19 @@ void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index) { } } +void IS31FL_common_flush(void) { + IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); +#if defined(DRIVER_ADDR_2) + IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); +# if defined(DRIVER_ADDR_3) + IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); +# if defined(DRIVER_ADDR_4) + IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); +# endif +# endif +#endif +} + #ifdef RGB_MATRIX_ENABLE // Colour is set by adjusting PWM register void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { diff --git a/drivers/led/issi/is31flcommon.h b/drivers/led/issi/is31flcommon.h index 93533e14de9..c380f2a8d6a 100644 --- a/drivers/led/issi/is31flcommon.h +++ b/drivers/led/issi/is31flcommon.h @@ -67,6 +67,8 @@ void IS31FL_common_init(uint8_t addr, uint8_t ssr); void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index); void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index); +void IS31FL_common_flush(void); + #ifdef RGB_MATRIX_ENABLE // RGB Matrix Specific scripts void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); diff --git a/drivers/led/snled27351-simple.c b/drivers/led/snled27351-simple.c index 499769555c4..882fe4e8b49 100644 --- a/drivers/led/snled27351-simple.c +++ b/drivers/led/snled27351-simple.c @@ -203,6 +203,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } +void snled27351_flush(void) { + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0); +#if defined(SNLED27351_I2C_ADDRESS_2) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1); +# if defined(SNLED27351_I2C_ADDRESS_3) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2); +# if defined(SNLED27351_I2C_ADDRESS_4) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} + void snled27351_sw_return_normal(uint8_t addr) { // Select to function page snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE); diff --git a/drivers/led/snled27351-simple.h b/drivers/led/snled27351-simple.h index ff71b44b916..999b70f8917 100644 --- a/drivers/led/snled27351-simple.h +++ b/drivers/led/snled27351-simple.h @@ -82,6 +82,8 @@ void snled27351_set_led_control_register(uint8_t index, bool value); void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index); void snled27351_update_led_control_registers(uint8_t addr, uint8_t index); +void snled27351_flush(void); + void snled27351_sw_return_normal(uint8_t addr); void snled27351_sw_shutdown(uint8_t addr); diff --git a/drivers/led/snled27351.c b/drivers/led/snled27351.c index 1ca691b30f2..198b190dac8 100644 --- a/drivers/led/snled27351.c +++ b/drivers/led/snled27351.c @@ -218,6 +218,19 @@ void snled27351_update_led_control_registers(uint8_t addr, uint8_t index) { g_led_control_registers_update_required[index] = false; } +void snled27351_flush(void) { + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0); +#if defined(SNLED27351_I2C_ADDRESS_2) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1); +# if defined(SNLED27351_I2C_ADDRESS_3) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2); +# if defined(SNLED27351_I2C_ADDRESS_4) + snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3); +# endif +# endif +#endif +} + void snled27351_sw_return_normal(uint8_t addr) { // Select to function page snled27351_write_register(addr, SNLED27351_REG_CONFIGURE_CMD_PAGE, SNLED27351_FUNCTION_PAGE); diff --git a/drivers/led/snled27351.h b/drivers/led/snled27351.h index 67047c89217..59d56855f3c 100644 --- a/drivers/led/snled27351.h +++ b/drivers/led/snled27351.h @@ -96,6 +96,8 @@ void snled27351_set_led_control_register(uint8_t index, bool red, bool green, bo void snled27351_update_pwm_buffers(uint8_t addr, uint8_t index); void snled27351_update_led_control_registers(uint8_t addr, uint8_t index); +void snled27351_flush(void); + void snled27351_sw_return_normal(uint8_t addr); void snled27351_sw_shutdown(uint8_t addr); diff --git a/keyboards/aeboards/satellite/rev1/rev1.c b/keyboards/aeboards/satellite/rev1/rev1.c index 8e4b5f41669..4c6e7d6d7c6 100644 --- a/keyboards/aeboards/satellite/rev1/rev1.c +++ b/keyboards/aeboards/satellite/rev1/rev1.c @@ -145,8 +145,10 @@ led_config_t g_led_config = { { // Custom Driver static void init(void) { i2c_init(); + is31fl3731_init(IS31FL3731_I2C_ADDRESS_1); is31fl3731_init(IS31FL3731_I2C_ADDRESS_2); + for (int index = 0; index < ISSI_DRIVER_TOTAL; index++) { bool enabled = !( ( index == 18+5) || //B5 ( index == 36+17) || //C17 @@ -154,29 +156,16 @@ static void init(void) { ); is31fl3731_set_led_control_register(index, enabled, enabled, enabled); } + is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_1, 0); is31fl3731_update_led_control_registers(IS31FL3731_I2C_ADDRESS_2, 1); } -static void flush(void) { - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); -} - -static void set_color(int index, uint8_t red, uint8_t green, uint8_t blue) { - is31fl3731_set_color(index, red, green, blue); -} - -static void set_color_all(uint8_t red, uint8_t green, uint8_t blue) { - is31fl3731_set_color_all( red, green, blue ); -} - - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, - .set_color = set_color, - .set_color_all = set_color_all + .flush = is31fl3731_flush, + .set_color = is31fl3731_set_color, + .set_color_all = is31fl3731_set_color_all }; #endif diff --git a/keyboards/fallacy/indicators.c b/keyboards/fallacy/indicators.c index ae4f796ecc7..a8630d2e113 100755 --- a/keyboards/fallacy/indicators.c +++ b/keyboards/fallacy/indicators.c @@ -36,7 +36,7 @@ void init_fallacy_leds(void) { /* update the buffer */ void update_fallacy_leds(void) { - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); + is31fl3731_flush(); } diff --git a/keyboards/hs60/v2/ansi/config.h b/keyboards/hs60/v2/ansi/config.h index 8b31f0e0660..3600b30feb5 100644 --- a/keyboards/hs60/v2/ansi/config.h +++ b/keyboards/hs60/v2/ansi/config.h @@ -53,7 +53,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } -#define IS31FL3733_DRIVER_COUNT 2 +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_DRIVER_COUNT 1 #define RGB_MATRIX_LED_COUNT 64 // These define which keys in the matrix are alphas/mods diff --git a/keyboards/hs60/v2/hhkb/config.h b/keyboards/hs60/v2/hhkb/config.h index 7494b2e66cb..bdc27435cf5 100644 --- a/keyboards/hs60/v2/hhkb/config.h +++ b/keyboards/hs60/v2/hhkb/config.h @@ -53,7 +53,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } -#define IS31FL3733_DRIVER_COUNT 2 +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_DRIVER_COUNT 1 #define RGB_MATRIX_LED_COUNT 64 // These define which keys in the matrix are alphas/mods diff --git a/keyboards/hs60/v2/iso/config.h b/keyboards/hs60/v2/iso/config.h index 22608404b54..9a9a4ed623d 100644 --- a/keyboards/hs60/v2/iso/config.h +++ b/keyboards/hs60/v2/iso/config.h @@ -50,7 +50,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } -#define IS31FL3733_DRIVER_COUNT 2 +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_DRIVER_COUNT 1 #define RGB_MATRIX_LED_COUNT 64 // These define which keys in the matrix are alphas/mods diff --git a/keyboards/inland/v83p/config.h b/keyboards/inland/v83p/config.h index c433b568dda..1cd93e20339 100644 --- a/keyboards/inland/v83p/config.h +++ b/keyboards/inland/v83p/config.h @@ -9,9 +9,9 @@ { C11 } /* I2C Config for LED Driver */ -#define DRIVER_COUNT 2 -#define DRIVER_ADDR_1 0b1110100 -#define DRIVER_ADDR_2 0b1110111 +#define SNLED27351_DRIVER_COUNT 2 +#define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND +#define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO #define I2C1_SDA_PIN B7 #define I2C1_SCL_PIN B6 #define I2C1_SCL_PAL_MODE 4 diff --git a/keyboards/inland/v83p/info.json b/keyboards/inland/v83p/info.json index d7a418bccfb..f738af3ef72 100644 --- a/keyboards/inland/v83p/info.json +++ b/keyboards/inland/v83p/info.json @@ -33,7 +33,7 @@ ] }, "rgb_matrix": { - "driver": "ckled2001", + "driver": "snled27351", "max_brightness": 180, "animations": { "solid_color": true, diff --git a/keyboards/inland/v83p/v83p.c b/keyboards/inland/v83p/v83p.c index 26ab62784aa..3cb9c06cb05 100644 --- a/keyboards/inland/v83p/v83p.c +++ b/keyboards/inland/v83p/v83p.c @@ -5,7 +5,7 @@ // clang-format off #ifdef RGB_MATRIX_ENABLE -const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { +const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/input_club/k_type/is31fl3733-dual.c b/keyboards/input_club/k_type/is31fl3733-dual.c index ea523eea1f6..54e9d76960b 100644 --- a/keyboards/input_club/k_type/is31fl3733-dual.c +++ b/keyboards/input_club/k_type/is31fl3733-dual.c @@ -248,3 +248,10 @@ void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index) { } g_led_control_registers_update_required[index] = false; } + +void is31fl3733_flush(void) { + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); +# ifdef USE_I2C2 + is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); +# endif +} diff --git a/keyboards/input_club/k_type/is31fl3733-dual.h b/keyboards/input_club/k_type/is31fl3733-dual.h index 7a43bc49f48..33943af3202 100644 --- a/keyboards/input_club/k_type/is31fl3733-dual.h +++ b/keyboards/input_club/k_type/is31fl3733-dual.h @@ -64,6 +64,8 @@ void is31fl3733_set_led_control_register(uint8_t index, bool red, bool green, bo void is31fl3733_update_pwm_buffers(uint8_t addr, uint8_t index); // index is the driver index void is31fl3733_update_led_control_registers(uint8_t addr, uint8_t index); +void is31fl3733_flush(void); + #define IS31FL3733_PUR_0R 0x00 // No PUR resistor #define IS31FL3733_PUR_05KR 0x02 // 0.5k Ohm resistor in t_NOL #define IS31FL3733_PUR_3KR 0x03 // 3.0k Ohm resistor on all the time diff --git a/keyboards/input_club/k_type/k_type-rgbdriver.c b/keyboards/input_club/k_type/k_type-rgbdriver.c index be16179ce28..1e8132e6dc0 100644 --- a/keyboards/input_club/k_type/k_type-rgbdriver.c +++ b/keyboards/input_club/k_type/k_type-rgbdriver.c @@ -38,16 +38,9 @@ static void init(void) { # endif } -static void flush(void) { - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); -# ifdef USE_I2C2 - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3733_flush, .set_color = is31fl3733_set_color, .set_color_all = is31fl3733_set_color_all, }; diff --git a/keyboards/keebwerk/mega/ansi/config.h b/keyboards/keebwerk/mega/ansi/config.h index a9734683f4c..ee98c956363 100755 --- a/keyboards/keebwerk/mega/ansi/config.h +++ b/keyboards/keebwerk/mega/ansi/config.h @@ -50,6 +50,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA #define IS31FL3733_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 128 diff --git a/keyboards/keebwerk/mega/ansi/keymaps/jesusvallejo/keymap.c b/keyboards/keebwerk/mega/ansi/keymaps/jesusvallejo/keymap.c index 2b5d658f02a..307eac90e1f 100644 --- a/keyboards/keebwerk/mega/ansi/keymaps/jesusvallejo/keymap.c +++ b/keyboards/keebwerk/mega/ansi/keymaps/jesusvallejo/keymap.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "drivers/issi/is31fl3733.h" +#include "drivers/led/issi/is31fl3733.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -50,9 +50,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { static uint16_t ledTimer; -uint8_t R = 0; /* First led*/ -uint8_t G = 0; /* Second led*/ -uint8_t B = 0; /* Third led*/ +uint8_t r = 0; /* First led*/ +uint8_t g = 0; /* Second led*/ +uint8_t b = 0; /* Third led*/ /* Boot animation parameters */ @@ -74,44 +74,44 @@ bool bootAnimation(void){ if (bootFirst>0 || bootSec>0){ if(bootFirst!=0){ if (timer_elapsed(ledTimer) > 150){ - G = 255; - R = 0; - B = 0; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 255; + r = 0; + b = 0; + is31fl3733_set_color( 6+64-1, r, g, b ); } if (timer_elapsed(ledTimer) > 300){ - G = 255; - R = 255; - B = 0; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 255; + r = 255; + b = 0; + is31fl3733_set_color( 6+64-1, r, g, b ); } if (timer_elapsed(ledTimer) > 400){ - G = 255; - R = 255; - B = 255; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 255; + r = 255; + b = 255; + is31fl3733_set_color( 6+64-1, r, g, b ); } if (timer_elapsed(ledTimer) > 500){ - G = 0; - R = 0; - B = 0; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 0; + r = 0; + b = 0; + is31fl3733_set_color( 6+64-1, r, g, b ); ledTimer = timer_read(); bootFirst--; } } if (bootFirst==0 && bootSec!=0){ if (timer_elapsed(ledTimer) > 200) { - G = 255; - R = 255; - B = 255; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 255; + r = 255; + b = 255; + is31fl3733_set_color( 6+64-1, r, g, b ); } if (timer_elapsed(ledTimer) > 400){ - G = 0; - R = 0; - B = 0; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 0; + r = 0; + b = 0; + is31fl3733_set_color( 6+64-1, r, g, b ); ledTimer = timer_read(); bootSec--; } @@ -125,29 +125,29 @@ bool bootAnimation(void){ void breathing(void) { if(timer_elapsed(ledTimer) fadeTime && R fadeTime && r fadeTime && R>minBrightness){ - G-=fadeStep; - R-=fadeStep; - B-=fadeStep; - is31fl3733_set_color( 6+64-1, R, G, B ); + if((time - previousTime) > fadeTime && r>minBrightness){ + g-=fadeStep; + r-=fadeStep; + b-=fadeStep; + is31fl3733_set_color( 6+64-1, r, g, b ); previousTime = time; } } else { - R=0; - G=0; - B=0; - is31fl3733_set_color( 6+64-1, R, G, B ); + r=0; + g=0; + b=0; + is31fl3733_set_color( 6+64-1, r, g, b ); previousTime = 0; time = 0; ledTimer=timer_read(); @@ -166,10 +166,10 @@ void matrix_scan_user(void){ prevCapsState = capsState; } else if(!capsState && capsState != prevCapsState){ - G = 0; - R = 0; - B = 0; - is31fl3733_set_color( 6+64-1, R, G, B ); + g = 0; + r = 0; + b = 0; + is31fl3733_set_color( 6+64-1, r, g, b ); prevCapsState = capsState; } } diff --git a/keyboards/matrix/m20add/rgb_ring.c b/keyboards/matrix/m20add/rgb_ring.c index c56ee931ee3..553a3d53605 100644 --- a/keyboards/matrix/m20add/rgb_ring.c +++ b/keyboards/matrix/m20add/rgb_ring.c @@ -396,7 +396,7 @@ void rgb_ring_task(void) break; }; - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); + is31fl3731_flush(); } bool process_record_kb(uint16_t keycode, keyrecord_t *record) diff --git a/keyboards/monsgeek/m3/config.h b/keyboards/monsgeek/m3/config.h index 85eb5b8e99e..93ffa1f07c4 100644 --- a/keyboards/monsgeek/m3/config.h +++ b/keyboards/monsgeek/m3/config.h @@ -36,9 +36,9 @@ #define WEAR_LEVELING_BACKING_SIZE (8 * 1024) /* I2C Config for LED Driver */ -#define DRIVER_COUNT 2 -#define DRIVER_ADDR_1 0b1110100 -#define DRIVER_ADDR_2 0b1110111 +#define SNLED27351_DRIVER_COUNT 2 +#define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND +#define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_VDDIO #define I2C1_OPMODE OPMODE_I2C #define I2C1_CLOCK_SPEED 400000 /* 400000 */ diff --git a/keyboards/monsgeek/m3/info.json b/keyboards/monsgeek/m3/info.json index db646103f12..a93b0d47dcf 100644 --- a/keyboards/monsgeek/m3/info.json +++ b/keyboards/monsgeek/m3/info.json @@ -31,7 +31,7 @@ "caps_lock": "A15" }, "rgb_matrix": { - "driver": "ckled2001", + "driver": "snled27351", "max_brightness": 160, "animations": { "breathing": true, diff --git a/keyboards/monsgeek/m3/m3.c b/keyboards/monsgeek/m3/m3.c index 95bfb34789b..b7e197e6ace 100644 --- a/keyboards/monsgeek/m3/m3.c +++ b/keyboards/monsgeek/m3/m3.c @@ -17,7 +17,7 @@ #include "quantum.h" // clang-format off #ifdef RGB_MATRIX_ENABLE -const ckled2001_led PROGMEM g_ckled2001_leds[RGB_MATRIX_LED_COUNT] = { +const snled27351_led_t PROGMEM g_snled27351_leds[RGB_MATRIX_LED_COUNT] = { /* Refer to IS31 manual for these locations * driver * | R location diff --git a/keyboards/neson_design/700e/700e.c b/keyboards/neson_design/700e/700e.c index 395ae4759ad..d4aa336edb5 100644 --- a/keyboards/neson_design/700e/700e.c +++ b/keyboards/neson_design/700e/700e.c @@ -341,10 +341,7 @@ void housekeeping_task_kb(void) } } - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); -#ifdef IS31FL3731_I2C_ADDRESS_2 - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); -#endif + is31fl3731_flush(); housekeeping_task_user(); } diff --git a/keyboards/neson_design/n6/n6.c b/keyboards/neson_design/n6/n6.c index e6531bc2c4e..5f3ae3a169d 100644 --- a/keyboards/neson_design/n6/n6.c +++ b/keyboards/neson_design/n6/n6.c @@ -343,10 +343,7 @@ void housekeeping_task_kb(void) } } - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); -#ifdef IS31FL3731_I2C_ADDRESS_2 - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); -#endif + is31fl3731_flush(); housekeeping_task_user(); } diff --git a/keyboards/novelkeys/nk65/config.h b/keyboards/novelkeys/nk65/config.h index 80327af4917..4dc1ab91656 100755 --- a/keyboards/novelkeys/nk65/config.h +++ b/keyboards/novelkeys/nk65/config.h @@ -50,6 +50,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA #define IS31FL3733_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 128 diff --git a/keyboards/novelkeys/nk87/config.h b/keyboards/novelkeys/nk87/config.h index d2949ef6d37..3b3e9309c11 100755 --- a/keyboards/novelkeys/nk87/config.h +++ b/keyboards/novelkeys/nk87/config.h @@ -50,6 +50,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA #define IS31FL3733_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 128 diff --git a/keyboards/spaceholdings/nebula12/config.h b/keyboards/spaceholdings/nebula12/config.h index d6e8f0e196e..5e4b48927f0 100755 --- a/keyboards/spaceholdings/nebula12/config.h +++ b/keyboards/spaceholdings/nebula12/config.h @@ -73,6 +73,7 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND #define IS31FL3731_DRIVER_COUNT 1 #define RGB_MATRIX_LED_COUNT 16 diff --git a/keyboards/spaceholdings/nebula68/config.h b/keyboards/spaceholdings/nebula68/config.h index f6df627592b..0283a4a036f 100755 --- a/keyboards/spaceholdings/nebula68/config.h +++ b/keyboards/spaceholdings/nebula68/config.h @@ -56,6 +56,8 @@ along with this program. If not, see . #define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 } #define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 } +#define IS31FL3733_I2C_ADDRESS_1 IS31FL3733_I2C_ADDRESS_GND_GND +#define IS31FL3733_I2C_ADDRESS_2 IS31FL3733_I2C_ADDRESS_GND_SDA #define IS31FL3733_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 128 diff --git a/keyboards/tkc/portico/config.h b/keyboards/tkc/portico/config.h index 9a8e19171f8..5599f2a36b1 100644 --- a/keyboards/tkc/portico/config.h +++ b/keyboards/tkc/portico/config.h @@ -48,6 +48,8 @@ along with this program. If not, see . #else // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 67 diff --git a/keyboards/tkc/portico75/config.h b/keyboards/tkc/portico75/config.h index d5b401704ba..756dfbb54a9 100644 --- a/keyboards/tkc/portico75/config.h +++ b/keyboards/tkc/portico75/config.h @@ -79,6 +79,7 @@ along with this program. If not, see . # define DRIVER_INDICATOR_LED_TOTAL 0 #else // WT_RGB IS31FL3741 driver code +# define IS31FL3741_I2C_ADDRESS_1 IS31FL3741_I2C_ADDRESS_GND # define IS31FL3741_DRIVER_COUNT 1 # define RGB_MATRIX_LED_COUNT 98 diff --git a/keyboards/wilba_tech/rama_works_kara/config.h b/keyboards/wilba_tech/rama_works_kara/config.h index b3fa3808ec8..5d8c9df8206 100644 --- a/keyboards/wilba_tech/rama_works_kara/config.h +++ b/keyboards/wilba_tech/rama_works_kara/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_koyu/config.h b/keyboards/wilba_tech/rama_works_koyu/config.h index 85bbf280510..aad4cd12ac2 100644 --- a/keyboards/wilba_tech/rama_works_koyu/config.h +++ b/keyboards/wilba_tech/rama_works_koyu/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_m10_c/config.h b/keyboards/wilba_tech/rama_works_m10_c/config.h index b3cb0ef7a8b..529896f6eda 100644 --- a/keyboards/wilba_tech/rama_works_m10_c/config.h +++ b/keyboards/wilba_tech/rama_works_m10_c/config.h @@ -21,6 +21,7 @@ #define LOCKING_RESYNC_ENABLE // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND #define IS31FL3731_DRIVER_COUNT 1 #define RGB_MATRIX_LED_COUNT 12 diff --git a/keyboards/wilba_tech/rama_works_m50_a/config.h b/keyboards/wilba_tech/rama_works_m50_a/config.h index 16439309bec..599550b91f6 100644 --- a/keyboards/wilba_tech/rama_works_m50_a/config.h +++ b/keyboards/wilba_tech/rama_works_m50_a/config.h @@ -21,6 +21,8 @@ #define LOCKING_RESYNC_ENABLE // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_m60_a/config.h b/keyboards/wilba_tech/rama_works_m60_a/config.h index 7cec5dcc21e..bc7d7e61287 100644 --- a/keyboards/wilba_tech/rama_works_m60_a/config.h +++ b/keyboards/wilba_tech/rama_works_m60_a/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_m65_b/config.h b/keyboards/wilba_tech/rama_works_m65_b/config.h index 88f8341aa60..b3e381d77db 100644 --- a/keyboards/wilba_tech/rama_works_m65_b/config.h +++ b/keyboards/wilba_tech/rama_works_m65_b/config.h @@ -21,6 +21,8 @@ #define LOCKING_RESYNC_ENABLE // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_m65_bx/config.h b/keyboards/wilba_tech/rama_works_m65_bx/config.h index be3af2f6689..8070e917d74 100644 --- a/keyboards/wilba_tech/rama_works_m65_bx/config.h +++ b/keyboards/wilba_tech/rama_works_m65_bx/config.h @@ -21,6 +21,8 @@ #define LOCKING_RESYNC_ENABLE // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/rama_works_u80_a/config.h b/keyboards/wilba_tech/rama_works_u80_a/config.h index 0d8e1e12b5c..4ab2d53c3c9 100644 --- a/keyboards/wilba_tech/rama_works_u80_a/config.h +++ b/keyboards/wilba_tech/rama_works_u80_a/config.h @@ -38,6 +38,9 @@ //#define NO_ACTION_ONESHOT // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA +#define IS31FL3731_I2C_ADDRESS_3 IS31FL3731_I2C_ADDRESS_SCL #define IS31FL3731_DRIVER_COUNT 3 #define RGB_MATRIX_LED_COUNT 108 diff --git a/keyboards/wilba_tech/wt60_b/config.h b/keyboards/wilba_tech/wt60_b/config.h index c5818173ca5..c5fb1b32c76 100644 --- a/keyboards/wilba_tech/wt60_b/config.h +++ b/keyboards/wilba_tech/wt60_b/config.h @@ -23,6 +23,8 @@ // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/wt60_bx/config.h b/keyboards/wilba_tech/wt60_bx/config.h index 37ffe646bce..f87d9ff48e3 100644 --- a/keyboards/wilba_tech/wt60_bx/config.h +++ b/keyboards/wilba_tech/wt60_bx/config.h @@ -23,6 +23,8 @@ // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/wt60_c/config.h b/keyboards/wilba_tech/wt60_c/config.h index 80f894e4514..4a1b8b6ad2b 100644 --- a/keyboards/wilba_tech/wt60_c/config.h +++ b/keyboards/wilba_tech/wt60_c/config.h @@ -23,6 +23,8 @@ // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index acb2c3aec79..4add18b14eb 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -469,7 +469,7 @@ void backlight_config_save(void) void backlight_update_pwm_buffers(void) { - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0); + is31fl3736_flush(); } bool process_record_backlight(uint16_t keycode, keyrecord_t *record) diff --git a/keyboards/wilba_tech/zeal60/config.h b/keyboards/wilba_tech/zeal60/config.h index 31ee2942ce0..3233c6187d7 100644 --- a/keyboards/wilba_tech/zeal60/config.h +++ b/keyboards/wilba_tech/zeal60/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/wilba_tech/zeal65/config.h b/keyboards/wilba_tech/zeal65/config.h index 7370931df1a..1046ee81089 100644 --- a/keyboards/wilba_tech/zeal65/config.h +++ b/keyboards/wilba_tech/zeal65/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 72 diff --git a/keyboards/xelus/dawn60/rev1/config.h b/keyboards/xelus/dawn60/rev1/config.h index b895890388b..c7945df3d6a 100644 --- a/keyboards/xelus/dawn60/rev1/config.h +++ b/keyboards/xelus/dawn60/rev1/config.h @@ -16,6 +16,8 @@ #pragma once // IS31FL3731 driver +#define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND +#define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_SDA #define IS31FL3731_DRIVER_COUNT 2 #define RGB_MATRIX_LED_COUNT 64 diff --git a/keyboards/xelus/pachi/rgb/rev1/rev1.c b/keyboards/xelus/pachi/rgb/rev1/rev1.c index b54b2a0a1db..1a3d9b2f4d4 100644 --- a/keyboards/xelus/pachi/rgb/rev1/rev1.c +++ b/keyboards/xelus/pachi/rgb/rev1/rev1.c @@ -226,13 +226,9 @@ static void init(void) { is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0); } -static void flush(void) { - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3741_flush, .set_color = is31fl3741_set_color, .set_color_all = is31fl3741_set_color_all }; diff --git a/keyboards/xelus/pachi/rgb/rev2/rev2.c b/keyboards/xelus/pachi/rgb/rev2/rev2.c index 744e7838b10..729b6b05453 100644 --- a/keyboards/xelus/pachi/rgb/rev2/rev2.c +++ b/keyboards/xelus/pachi/rgb/rev2/rev2.c @@ -232,13 +232,9 @@ static void init(void) { is31fl3741_update_led_control_registers(IS31FL3741_I2C_ADDRESS_1, 0); } -static void flush(void) { - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3741_flush, .set_color = is31fl3741_set_color, .set_color_all = is31fl3741_set_color_all }; diff --git a/quantum/led_matrix/led_matrix_drivers.c b/quantum/led_matrix/led_matrix_drivers.c index 42594d2e166..ab8da3353ac 100644 --- a/quantum/led_matrix/led_matrix_drivers.c +++ b/quantum/led_matrix/led_matrix_drivers.c @@ -249,159 +249,64 @@ static void init(void) { } # if defined(LED_MATRIX_IS31FL3218) -static void flush(void) { - is31fl3218_update_pwm_buffers(); -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3218_update_pwm_buffers, .set_value = is31fl3218_set_value, .set_value_all = is31fl3218_set_value_all, }; # elif defined(LED_MATRIX_IS31FL3731) -static void flush(void) { - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); -# if defined(IS31FL3731_I2C_ADDRESS_2) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); -# if defined(IS31FL3731_I2C_ADDRESS_3) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2); -# if defined(IS31FL3731_I2C_ADDRESS_4) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3731_flush, .set_value = is31fl3731_set_value, .set_value_all = is31fl3731_set_value_all, }; # elif defined(LED_MATRIX_IS31FL3733) -static void flush(void) { - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); -# if defined(IS31FL3733_I2C_ADDRESS_2) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); -# if defined(IS31FL3733_I2C_ADDRESS_3) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2); -# if defined(IS31FL3733_I2C_ADDRESS_4) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3733_flush, .set_value = is31fl3733_set_value, .set_value_all = is31fl3733_set_value_all, }; # elif defined(LED_MATRIX_IS31FL3736) -static void flush(void) { - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0); -# if defined(IS31FL3736_I2C_ADDRESS_2) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1); -# if defined(IS31FL3736_I2C_ADDRESS_3) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2); -# if defined(IS31FL3736_I2C_ADDRESS_4) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3736_flush, .set_value = is31fl3736_set_value, .set_value_all = is31fl3736_set_value_all, }; # elif defined(LED_MATRIX_IS31FL3737) -static void flush(void) { - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0); -# if defined(IS31FL3737_I2C_ADDRESS_2) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1); -# if defined(IS31FL3737_I2C_ADDRESS_3) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2); -# if defined(IS31FL3737_I2C_ADDRESS_4) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3737_flush, .set_value = is31fl3737_set_value, .set_value_all = is31fl3737_set_value_all, }; # elif defined(LED_MATRIX_IS31FL3741) -static void flush(void) { - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); -# if defined(IS31FL3741_I2C_ADDRESS_2) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1); -# if defined(IS31FL3741_I2C_ADDRESS_3) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2); -# if defined(IS31FL3741_I2C_ADDRESS_4) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3741_flush, .set_value = is31fl3741_set_value, .set_value_all = is31fl3741_set_value_all, }; # elif defined(IS31FLCOMMON) -static void flush(void) { - IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); -# if defined(LED_DRIVER_ADDR_2) - IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); -# if defined(LED_DRIVER_ADDR_3) - IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); -# if defined(LED_DRIVER_ADDR_4) - IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = IS31FL_common_flush, .set_value = IS31FL_simple_set_brightness, .set_value_all = IS31FL_simple_set_brigntness_all, }; # elif defined(LED_MATRIX_SNLED27351) -static void flush(void) { - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0); -# if defined(SNLED27351_I2C_ADDRESS_2) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1); -# if defined(SNLED27351_I2C_ADDRESS_3) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2); -# if defined(SNLED27351_I2C_ADDRESS_4) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const led_matrix_driver_t led_matrix_driver = { .init = init, - .flush = flush, + .flush = snled27351_flush, .set_value = snled27351_set_value, .set_value_all = snled27351_set_value_all, }; diff --git a/quantum/rgb_matrix/rgb_matrix_drivers.c b/quantum/rgb_matrix/rgb_matrix_drivers.c index 555e750e508..0fe93ee0778 100644 --- a/quantum/rgb_matrix/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix/rgb_matrix_drivers.c @@ -247,160 +247,65 @@ static void init(void) { } # if defined(RGB_MATRIX_IS31FL3218) -static void flush(void) { - is31fl3218_update_pwm_buffers(); -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3218_update_pwm_buffers, .set_color = is31fl3218_set_color, .set_color_all = is31fl3218_set_color_all, }; # elif defined(RGB_MATRIX_IS31FL3731) -static void flush(void) { - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_1, 0); -# if defined(IS31FL3731_I2C_ADDRESS_2) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_2, 1); -# if defined(IS31FL3731_I2C_ADDRESS_3) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_3, 2); -# if defined(IS31FL3731_I2C_ADDRESS_4) - is31fl3731_update_pwm_buffers(IS31FL3731_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3731_flush, .set_color = is31fl3731_set_color, .set_color_all = is31fl3731_set_color_all, }; # elif defined(RGB_MATRIX_IS31FL3733) -static void flush(void) { - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_1, 0); -# if defined(IS31FL3733_I2C_ADDRESS_2) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_2, 1); -# if defined(IS31FL3733_I2C_ADDRESS_3) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_3, 2); -# if defined(IS31FL3733_I2C_ADDRESS_4) - is31fl3733_update_pwm_buffers(IS31FL3733_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3733_flush, .set_color = is31fl3733_set_color, .set_color_all = is31fl3733_set_color_all, }; # elif defined(RGB_MATRIX_IS31FL3736) -static void flush(void) { - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_1, 0); -# if defined(IS31FL3736_I2C_ADDRESS_2) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_2, 1); -# if defined(IS31FL3736_I2C_ADDRESS_3) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_3, 2); -# if defined(IS31FL3736_I2C_ADDRESS_4) - is31fl3736_update_pwm_buffers(IS31FL3736_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3736_flush, .set_color = is31fl3736_set_color, .set_color_all = is31fl3736_set_color_all, }; # elif defined(RGB_MATRIX_IS31FL3737) -static void flush(void) { - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_1, 0); -# if defined(IS31FL3737_I2C_ADDRESS_2) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_2, 1); -# if defined(IS31FL3737_I2C_ADDRESS_3) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_3, 2); -# if defined(IS31FL3737_I2C_ADDRESS_4) - is31fl3737_update_pwm_buffers(IS31FL3737_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3737_flush, .set_color = is31fl3737_set_color, .set_color_all = is31fl3737_set_color_all, }; # elif defined(RGB_MATRIX_IS31FL3741) -static void flush(void) { - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_1, 0); -# if defined(IS31FL3741_I2C_ADDRESS_2) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_2, 1); -# if defined(IS31FL3741_I2C_ADDRESS_3) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_3, 2); -# if defined(IS31FL3741_I2C_ADDRESS_4) - is31fl3741_update_pwm_buffers(IS31FL3741_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = is31fl3741_flush, .set_color = is31fl3741_set_color, .set_color_all = is31fl3741_set_color_all, }; # elif defined(IS31FLCOMMON) -static void flush(void) { - IS31FL_common_update_pwm_register(DRIVER_ADDR_1, 0); -# if defined(DRIVER_ADDR_2) - IS31FL_common_update_pwm_register(DRIVER_ADDR_2, 1); -# if defined(DRIVER_ADDR_3) - IS31FL_common_update_pwm_register(DRIVER_ADDR_3, 2); -# if defined(DRIVER_ADDR_4) - IS31FL_common_update_pwm_register(DRIVER_ADDR_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = IS31FL_common_flush, .set_color = IS31FL_RGB_set_color, .set_color_all = IS31FL_RGB_set_color_all, }; # elif defined(RGB_MATRIX_SNLED27351) -static void flush(void) { - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_1, 0); -# if defined(SNLED27351_I2C_ADDRESS_2) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_2, 1); -# if defined(SNLED27351_I2C_ADDRESS_3) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_3, 2); -# if defined(SNLED27351_I2C_ADDRESS_4) - snled27351_update_pwm_buffers(SNLED27351_I2C_ADDRESS_4, 3); -# endif -# endif -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = snled27351_flush, .set_color = snled27351_set_color, .set_color_all = snled27351_set_color_all, }; @@ -418,16 +323,9 @@ static void init(void) { # endif } -static void flush(void) { - aw20216s_update_pwm_buffers(AW20216S_CS_PIN_1, 0); -# if defined(AW20216S_CS_PIN_2) - aw20216s_update_pwm_buffers(AW20216S_CS_PIN_2, 1); -# endif -} - const rgb_matrix_driver_t rgb_matrix_driver = { .init = init, - .flush = flush, + .flush = aw20216s_flush, .set_color = aw20216s_set_color, .set_color_all = aw20216s_set_color_all, };