diff --git a/firmware/src/screen.rs b/firmware/src/screen.rs index 3c7a608..ee801f5 100644 --- a/firmware/src/screen.rs +++ b/firmware/src/screen.rs @@ -93,10 +93,12 @@ impl Screen for Splash { } } -/// Wait for network to become available -pub struct WifiConnecting; +/// Wait while a lengthy action is in progress +pub enum PleaseWait { + WifiConnecting, +} -impl Screen for WifiConnecting { +impl Screen for PleaseWait { fn draw>( &self, target: &mut D, @@ -110,7 +112,9 @@ impl Screen for WifiConnecting { target, )?; SMALL_FONT.render_aligned( - "WLAN Verbindung\nwird aufgebaut", + match *self { + Self::WifiConnecting => "WLAN Verbindung\nwird aufgebaut", + }, Point::new(63, 27 + 12), VerticalPosition::Baseline, HorizontalAlignment::Center, diff --git a/firmware/src/ui.rs b/firmware/src/ui.rs index 3ae4f1b..1c43efb 100644 --- a/firmware/src/ui.rs +++ b/firmware/src/ui.rs @@ -118,7 +118,9 @@ impl<'a, I2C: I2c, IRQ: Wait> Ui<'a, I2C, IRQ> { return Ok(()); } - self.display.screen(&screen::WifiConnecting).await?; + self.display + .screen(&screen::PleaseWait::WifiConnecting) + .await?; let wait_cancel = async { while self.keypad.read().await != Key::Cancel {} }; match with_timeout(NETWORK_TIMEOUT, select(self.wifi.wait_up(), wait_cancel)).await {