diff --git a/src/animation.rs b/src/animation.rs index 2a1df0c..e3078b2 100644 --- a/src/animation.rs +++ b/src/animation.rs @@ -139,8 +139,9 @@ impl DerefMut for AnimatedSurface { } } -impl From for AnimatedSurface { +impl From for AnimatedSurface { fn from(surface: S) -> Self { + trace!("create anim surface={surface:?}"); AnimatedSurface { surface, is_on: false, diff --git a/src/tasks/safetyui.rs b/src/tasks/safetyui.rs index 18ee18c..6b603df 100644 --- a/src/tasks/safetyui.rs +++ b/src/tasks/safetyui.rs @@ -7,8 +7,9 @@ use core::fmt::Debug; use futures::join; use log::*; -use crate::{animation::{AnimDisplay, AnimatedSurface, Animation}, graphics::display::{DisplayControls, SegmentSpace, Uniforms}, events::Notification, graphics::shaders::*, tasks::ui::UiSurfacePool}; +use crate::{animation::{AnimDisplay, AnimatedSurface, Animation}, events::{Notification, Prediction}, graphics::{display::{DisplayControls, SegmentSpace, Uniforms}, shaders::*}, tasks::ui::UiSurfacePool}; +#[derive(Debug)] pub struct SafetyUi { // Headlight and brakelight layers can only be overpainted by the bootsplash overlay layer headlight: AnimatedSurface, @@ -21,7 +22,7 @@ pub struct SafetyUi { impl>> SafetyUi { pub fn new>(surfaces: &mut SS, display: DisplayControls) -> Self where SS::Error: Debug { - Self { + let ret = Self { overlay: SurfaceBuilder::build(surfaces) .rect(Rectangle::everything()) .shader(Thinking::default()) @@ -40,7 +41,9 @@ impl, mut ui: SafetyUi<>::Surface>) { // Wait for the renderer to start running //ui.display.render_is_running.wait().await; + trace!("spooling until render starts ui={ui:?}"); ui.display.wait_until_render_is_running().await; + trace!("spooling wait task ui={ui:?}"); // Run the wake sequence, and turn on the lights ui.wake().await;