Fix bug with counting updated pixels

This commit is contained in:
Kuba Birecki 2023-06-21 12:36:20 +02:00
parent 8bcee4f3b9
commit 82591843d1

View file

@ -44,7 +44,7 @@ static const size_t drivers_size = DT_INST_PROP_LEN(0, drivers);
/**
* Array containing the number of LEDs handled by each device.
*/
static const uint8_t pixels_per_driver[] = DT_INST_PROP(0, chain_lengths);
static const size_t pixels_per_driver[] = DT_INST_PROP(0, chain_lengths);
/**
* Pointer to the root animation
@ -121,7 +121,7 @@ static void zmk_animation_tick(struct k_work *work) {
for (size_t i = 0; i < drivers_size; ++i) {
led_strip_update_rgb(drivers[i], &px_buffer[pixels_updated], pixels_per_driver[i]);
pixels_updated += (size_t)pixels_per_driver;
pixels_updated += pixels_per_driver[i];
}
}