graphics: display: implement dynamic target fps
This commit is contained in:
@@ -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;
|
||||
},
|
||||
} }
|
||||
|
||||
Reference in New Issue
Block a user