1
0
Fork 0

[Core] Optimisation - Add RGB LED colour set check in drivers (#21134)

This commit is contained in:
Xelus22 2023-06-08 11:58:53 +10:00 committed by GitHub
parent 9a6056d09c
commit d1d0925cf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 41 additions and 1 deletions

View file

@ -150,6 +150,9 @@ void CKLED2001_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (index >= 0 && index < RGB_MATRIX_LED_COUNT) {
memcpy_P(&led, (&g_ckled2001_leds[index]), sizeof(led));
if (g_pwm_buffer[led.driver][led.r] == red && g_pwm_buffer[led.driver][led.g] == green && g_pwm_buffer[led.driver][led.b] == blue) {
return;
}
g_pwm_buffer[led.driver][led.r] = red;
g_pwm_buffer[led.driver][led.g] = green;
g_pwm_buffer[led.driver][led.b] = blue;