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

@ -72,6 +72,9 @@ void IS31FL3218_init(void) {
}
void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
if (g_pwm_buffer[index * 3 + 0] == red && g_pwm_buffer[index * 3 + 1] == green && g_pwm_buffer[index * 3 + 2] == blue) {
return;
}
g_pwm_buffer[index * 3 + 0] = red;
g_pwm_buffer[index * 3 + 1] = green;
g_pwm_buffer[index * 3 + 2] = blue;