Add _flush() functions to LED drivers (#22308)

This commit is contained in:
Ryan
2023-10-23 03:32:27 +10:00
committed by GitHub
parent 1e9b299fb0
commit cf7d3435d7
72 changed files with 346 additions and 319 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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,
};