simplify pattern matching in leds task

This commit is contained in:
Sebastian Hugentobler 2024-10-17 12:07:09 +02:00
parent c373ba5859
commit 5ecefabd07
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0

View File

@ -72,10 +72,8 @@ pub async fn task(rows: [AnyPin; ROWS], cols: [AnyPin; COLS]) {
display.set(PATTERN_START); display.set(PATTERN_START);
loop { loop {
if let Some(msg) = state_sub.try_next_message_pure() { if let Some(state::StateChange::Pattern(new_pattern)) = state_sub.try_next_message_pure() {
if let state::StateChange::Pattern(new_pattern) = msg { display.set(new_pattern);
display.set(new_pattern);
}
} }
display.show().await; display.show().await;