graphics: display: implement dynamic target fps

This commit is contained in:
2026-03-09 10:16:02 +01:00
parent c77ecc9a19
commit f0d7968843
3 changed files with 32 additions and 11 deletions

View File

@@ -94,6 +94,7 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
if let Prediction::SetPersonality(personality) = event { match personality {
Personality::Active => {
// FIXME: These should be a Off/Low/High enum, so the stopping brake looks different from the dayrunning brake.
self.display.set_fps(DEFAULT_FPS);
warn!("Active personality: Turning on safety lights");
TURN_ON_FAST.apply([
&mut self.brakelight,
@@ -106,6 +107,7 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
&mut self.brakelight,
&mut self.headlight
]).await;
self.display.set_fps(LOW_POWER_FPS);
},
Personality::Sleeping => {
warn!("Sleeping personality: Safety UI is going to sleep");
@@ -113,6 +115,7 @@ impl<S: Debug + Surface<Uniforms = Uniforms, CoordinateSpace = SegmentSpace, Pix
},
Personality::Waking => {
warn!("Waking personality: Waking up safety UI");
self.display.set_fps(DEFAULT_FPS);
self.wake().await;
},
} }