Ensure the buffer is always reset before calculating each frame

This commit is contained in:
Kuba Birecki 2022-01-18 22:52:02 +01:00
parent eb1fc0a21b
commit 69de72c6f4

View file

@ -120,6 +120,11 @@ static void zmk_animation_tick(struct k_work *work) {
for (size_t i = 0; i < pixels_size; ++i) { for (size_t i = 0; i < pixels_size; ++i) {
zmk_rgb_to_led_rgb(&pixels[i].value, &px_buffer[i]); zmk_rgb_to_led_rgb(&pixels[i].value, &px_buffer[i]);
// Reset values for the next cycle
pixels[i].value.r = 0;
pixels[i].value.g = 0;
pixels[i].value.b = 0;
} }
size_t pixels_updated = 0; size_t pixels_updated = 0;