From 460a270e9081795a90c4133c784069cc47f66208 Mon Sep 17 00:00:00 2001 From: Jack Hogan Date: Sat, 12 Oct 2024 14:12:55 -0400 Subject: [PATCH] Set all LEDs to white while updating, bumped version --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6fe8644..17462c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1521,7 +1521,7 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "sign-firmware" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "async-io", diff --git a/Cargo.toml b/Cargo.toml index 638e4e8..de94753 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sign-firmware" -version = "0.1.0" +version = "0.1.1" authors = ["Jack Hogan "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/src/main.rs b/src/main.rs index d0cd389..475721a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,6 +27,7 @@ use esp_idf_svc::{ use http::Request; use lightning_time::LightningTime; use log::info; +use palette::rgb::Rgb; use sign_firmware::{Block, EspTlsSocket, Leds}; use std::net::TcpStream; use url::Url; @@ -330,6 +331,17 @@ async fn amain(mut leds: Leds, mut wifi: AsyncWifi>) { .await .expect("wifi connection"); + // Set all LEDs to white while checking for update + for block in [ + Block::Top, + Block::Center, + Block::BottomLeft, + Block::Right, + Block::BottomRight, + ] { + leds.set_color(Rgb::new(255, 255, 255), block).await; + } + // Check for update self_update().await.expect("Self-update to work");