From eaca9d8cec1092606b6437b19a4cbb6d103bcb3b Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 18 Jun 2025 15:35:33 +0200 Subject: [PATCH] code clean up --- src/hotspot.rs | 4 ++-- src/main.rs | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/hotspot.rs b/src/hotspot.rs index a929ae8..15f974a 100644 --- a/src/hotspot.rs +++ b/src/hotspot.rs @@ -1,7 +1,7 @@ use anyhow::{Result, anyhow}; use log::{trace, warn}; use smart_leds::colors::GREEN; -use std::env; +use std::{env, time::Duration}; use tokio::process::Command; use crate::{feedback::{self, FeedbackImpl}, hardware::Hotspot, spi_led}; @@ -128,7 +128,7 @@ impl Hotspot for NMHotspot { } feedback::CURRENTSTATUS = Ready; - FeedbackImpl::flash_led_for_duration(led, GREEN, 1000); + FeedbackImpl::flash_led_for_duration(led, GREEN, Duration::from_secs(1)); Ok(()) } diff --git a/src/main.rs b/src/main.rs index 7c80244..f8388fd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -175,6 +175,10 @@ async fn main() -> Result<()> { let webserver_handle = run_webserver(store.clone(), sse_tx, hotspot.clone()); + feedback::CURRENTSTATUS = Ready; + FeedbackImpl::beep_startup(buzzer); + FeedbackImpl::flash_led_for_duration(led, GREEN, Duration::from_secs(1)); + let run_result = try_join!(pm3_handle, loop_handle, webserver_handle); @@ -183,8 +187,5 @@ async fn main() -> Result<()> { return Err(e); } - feedback::CURRENTSTATUS = Ready; - FeedbackImpl::beep_startup(buzzer); - Ok(()) }