Skip to content

Commit 8315a3c

Browse files
committed
Handle booting up directly into sleep
Previously when SLEEP# is LOW while booting up the matrix, the startup animation would turn on the LEDs even though we're in sleep. And because we don't do anything while sleeping, the loop won't turn the LEDs off anymore. Now the matrix will stay off, if booting into sleep. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 1b4ff01 commit 8315a3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ledmatrix/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ fn main() -> ! {
262262
}
263263

264264
// Handle period display updates. Don't do it too often
265-
if timer.get_counter().ticks() > prev_timer + state.animation_period {
265+
let render_again = timer.get_counter().ticks() > prev_timer + state.animation_period;
266+
if matches!(state.sleeping, SleepState::Awake) && render_again {
266267
// On startup slowly turn the screen on - it's a pretty effect :)
267268
match startup_percentage {
268269
Some(p) if p <= 100 => {

0 commit comments

Comments
 (0)