diff --git a/firmware/src/screen.rs b/firmware/src/screen.rs index 852c465..c80b20d 100644 --- a/firmware/src/screen.rs +++ b/firmware/src/screen.rs @@ -1,5 +1,5 @@ -use crate::error; use crate::{GIT_SHA_STR, VERSION_STR}; +use core::fmt; use embedded_graphics::draw_target::DrawTarget; use embedded_graphics::image::{Image, ImageRaw}; use embedded_graphics::pixelcolor::BinaryColor; @@ -136,23 +136,28 @@ impl Screen for Splash { } /// Failure screen -pub struct Failure<'a> { - error: &'a error::Error, +pub struct Failure { + message: M, } -impl<'a> Failure<'a> { - pub fn new(error: &'a error::Error) -> Self { - Self { error } +impl Failure { + pub fn new(message: M) -> Self { + Self { message } } } -impl Screen for Failure<'_> { +impl Screen for Failure { fn draw>( &self, target: &mut D, ) -> Result<(), Error> { centered(&TITLE_FONT, 26, "FEHLER!", target)?; - centered(&SMALL_FONT, 26 + 12, format_args!("{}", self.error), target)?; + centered( + &SMALL_FONT, + 26 + 12, + format_args!("{}", self.message), + target, + )?; footer("* Abbruch", "", target)?; Ok(()) }