Skip to content

Commit

Permalink
Make reset animation match position
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Horacek <petr@zlosynth.com>
  • Loading branch information
phoracek committed Nov 12, 2023
1 parent 54ece4c commit eee6bd7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions control/src/cache/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,19 @@ fn leds_for_paused(cycles: u32) -> [bool; 8] {
}

fn leds_for_buffer_reset(progress: u32) -> [bool; 8] {
let mut leds = [false; 8];
for i in 0..8 - progress as usize {
leds[i] = true;
if progress < 4 {
let mut leds = [true; 8];
for i in 0..progress as usize {
leds[i] = false;
}
leds
} else {
let mut leds = [false; 8];
for i in 4..(4 + 8 - progress) as usize {
leds[i] = true;
}
leds
}
leds
}

fn phase_to_leds(phase: f32) -> [bool; 8] {
Expand Down

0 comments on commit eee6bd7

Please sign in to comment.