From 7bc65261d1f13d677d0945b76f9d70308004f430 Mon Sep 17 00:00:00 2001 From: JerrySB03 Date: Sat, 25 Jan 2025 10:31:03 +0100 Subject: [PATCH] Fix: only set the screen if animation is active --- ledmatrix/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ledmatrix/src/main.rs b/ledmatrix/src/main.rs index c4082c72..9f028a19 100644 --- a/ledmatrix/src/main.rs +++ b/ledmatrix/src/main.rs @@ -395,12 +395,16 @@ fn main() -> ! { } } - fill_grid_pixels(&state, &mut matrix); if state.animate { for x in 0..WIDTH { state.grid.0[x].rotate_right(1); } } + + if state.animate || state.upcoming_frames.is_some(){ + fill_grid_pixels(&state, &mut matrix); + } + animation_timer = timer.get_counter().ticks(); }