From d9fd112ee0e4aaab77d0a43ad19f08fd60b6fc8d Mon Sep 17 00:00:00 2001 From: Victoria Fischer Date: Mon, 22 Dec 2025 14:57:25 +0100 Subject: [PATCH] debug: add some more trace-level logging to animation and safetyui bits --- src/animation.rs | 3 ++- src/tasks/safetyui.rs | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) 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;