fix: debug button screen-off mode now works in park state
updateWakefulness was overriding display power every frame when ignition was on, fighting the screen-off set by home.cc. Now respects ScreenDisplayMode 3 unconditionally. Also auto-resets to mode 0 when shifting into drive from screen-off. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,7 @@ class Controls:
|
|||||||
self.always_on_lateral_main = self.always_on_lateral and self.params.get_bool("AlwaysOnLateralMain")
|
self.always_on_lateral_main = self.always_on_lateral and self.params.get_bool("AlwaysOnLateralMain")
|
||||||
|
|
||||||
self.drive_added = False
|
self.drive_added = False
|
||||||
|
self.was_driving_gear = False
|
||||||
self.fcw_random_event_triggered = False
|
self.fcw_random_event_triggered = False
|
||||||
self.holiday_theme_alerted = False
|
self.holiday_theme_alerted = False
|
||||||
self.onroad_distance_pressed = False
|
self.onroad_distance_pressed = False
|
||||||
@@ -1263,6 +1264,12 @@ class Controls:
|
|||||||
self.events.add(EventName.clpDebug)
|
self.events.add(EventName.clpDebug)
|
||||||
|
|
||||||
def clearpilot_state_control(self, CC, CS):
|
def clearpilot_state_control(self, CC, CS):
|
||||||
|
# CLEARPILOT: auto-reset display when shifting into drive from screen-off
|
||||||
|
if self.driving_gear and not self.was_driving_gear:
|
||||||
|
if self.params_memory.get_int("ScreenDisplayMode") == 3:
|
||||||
|
self.params_memory.put_int("ScreenDisplayMode", 0)
|
||||||
|
self.was_driving_gear = self.driving_gear
|
||||||
|
|
||||||
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
if any(be.pressed and be.type == FrogPilotButtonType.lkas for be in CS.buttonEvents):
|
||||||
current = self.params_memory.get_int("ScreenDisplayMode")
|
current = self.params_memory.get_int("ScreenDisplayMode")
|
||||||
|
|
||||||
|
|||||||
@@ -565,7 +565,10 @@ void Device::updateWakefulness(const UIState &s) {
|
|||||||
emit interactiveTimeout();
|
emit interactiveTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s.scene.screen_brightness_onroad != 0) {
|
// CLEARPILOT: ScreenDisplayMode 3 = screen off — override awake state
|
||||||
|
if (paramsMemory.getInt("ScreenDisplayMode") == 3) {
|
||||||
|
setAwake(false);
|
||||||
|
} else if (s.scene.screen_brightness_onroad != 0) {
|
||||||
setAwake(s.scene.ignition || interactive_timeout > 0);
|
setAwake(s.scene.ignition || interactive_timeout > 0);
|
||||||
} else {
|
} else {
|
||||||
setAwake(interactive_timeout > 0);
|
setAwake(interactive_timeout > 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user