1
0
Fork 0

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 346 additions and 319 deletions

View file

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