Skip to content

Commit 1f709c0

Browse files
committed
ledmatrix: Allow disabling startup animation
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 2de8b8d commit 1f709c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ledmatrix/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ enum SleepMode {
3131
/// slowly fade themm on/off
3232
const SLEEP_MODE: SleepMode = SleepMode::Fading;
3333

34+
const STARTUP_ANIMATION: bool = true;
35+
3436
const MAX_CURRENT: usize = 500;
3537

3638
/// Maximum brightness out of 255
@@ -234,6 +236,9 @@ fn main() -> ! {
234236
let mut game_timer = timer.get_counter().ticks();
235237

236238
let mut startup_percentage = Some(0);
239+
if !STARTUP_ANIMATION {
240+
state.grid = percentage(100);
241+
}
237242

238243
// Detect whether the sleep pin is connected
239244
// Early revisions of the hardware didn't have it wired up, if that is the
@@ -266,7 +271,7 @@ fn main() -> ! {
266271
if matches!(state.sleeping, SleepState::Awake) && render_again {
267272
// On startup slowly turn the screen on - it's a pretty effect :)
268273
match startup_percentage {
269-
Some(p) if p <= 100 => {
274+
Some(p) if p <= 100 && STARTUP_ANIMATION => {
270275
state.grid = percentage(p);
271276
startup_percentage = Some(p + 5);
272277
}

0 commit comments

Comments
 (0)