mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-04 15:56:08 +08:00
FrogPilot features - Only change personality if the GM menu is open
This commit is contained in:
@@ -169,6 +169,9 @@ class CarState(CarStateBase):
|
||||
ret.leftBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1
|
||||
ret.rightBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1
|
||||
|
||||
# FrogPilot CarState functions
|
||||
fp_ret.hasMenu = not (self.CP.flags & GMFlags.NO_CAMERA.value or self.CP.carFingerprint in CC_ONLY_CAR)
|
||||
|
||||
return ret, fp_ret
|
||||
|
||||
@staticmethod
|
||||
|
||||
Executable → Regular
+9
-2
@@ -182,6 +182,8 @@ class Controls:
|
||||
|
||||
self.update_toggles = False
|
||||
|
||||
self.display_timer = 0
|
||||
|
||||
def set_initial_state(self):
|
||||
if REPLAY:
|
||||
controls_state = self.params.get("ReplayControlsState")
|
||||
@@ -654,8 +656,13 @@ class Controls:
|
||||
# decrement personality on distance button press
|
||||
if self.CP.openpilotLongitudinalControl:
|
||||
if any(not be.pressed and be.type == ButtonType.gapAdjustCruise for be in CS.buttonEvents):
|
||||
self.personality = (self.personality - 1) % 3
|
||||
self.params.put_nonblocking('LongitudinalPersonality', str(self.personality))
|
||||
menu_open = self.display_timer > 0 or not self.sm['frogpilotCarState'].hasMenu
|
||||
if menu_open:
|
||||
self.personality = (self.personality - 1) % 3
|
||||
self.params.put_nonblocking('LongitudinalPersonality', str(self.personality))
|
||||
self.display_timer = 350
|
||||
|
||||
self.display_timer -= 1
|
||||
|
||||
FPCC = self.update_frogpilot_variables(CS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user