tasks: ui: docs++
This commit is contained in:
@@ -89,7 +89,6 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
|
|||||||
self.as_slice().set_visible(true);
|
self.as_slice().set_visible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Brakelight should only be toggled when actually braking or stationary
|
|
||||||
pub async fn apply_scene(&mut self, next_scene: Scene) {
|
pub async fn apply_scene(&mut self, next_scene: Scene) {
|
||||||
info!("Activating scene {next_scene:?}");
|
info!("Activating scene {next_scene:?}");
|
||||||
match next_scene {
|
match next_scene {
|
||||||
@@ -107,12 +106,10 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
|
|||||||
self.background.set_shader(Background::default());
|
self.background.set_shader(Background::default());
|
||||||
},
|
},
|
||||||
Scene::Idle => {
|
Scene::Idle => {
|
||||||
// FIXME: The safety UI task should handle setting the display brightness to 50% here
|
|
||||||
self.background.set_shader(Thinking::default());
|
self.background.set_shader(Thinking::default());
|
||||||
let fg_fade = Animation::default().duration(Duration::from_millis(300)).to(Fract8::MIN);
|
let fg_fade = Animation::default().duration(Duration::from_millis(300)).to(Fract8::MIN);
|
||||||
let bg_fade = Animation::default().duration(Duration::from_millis(300)).to(Fract8::from_raw(128));
|
let bg_fade = Animation::default().duration(Duration::from_millis(300)).to(Fract8::from_raw(128));
|
||||||
|
|
||||||
// FIXME: The scenes shouldn't be touching the brake/headlights at all here. In fact, they should be dealt with in a whole separate task from the main UI, maybe running on the motion prediction executor
|
|
||||||
embassy_futures::join::join(
|
embassy_futures::join::join(
|
||||||
fg_fade.apply([&mut self.tail, &mut self.panels, &mut self.motion]),
|
fg_fade.apply([&mut self.tail, &mut self.panels, &mut self.motion]),
|
||||||
bg_fade.apply([&mut self.background])
|
bg_fade.apply([&mut self.background])
|
||||||
|
|||||||
Reference in New Issue
Block a user