mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-11-03 10:37:52 +08:00
v cruise non pcm state
This commit is contained in:
@@ -100,8 +100,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise,
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise,
|
||||
enable_buttons=(ButtonType.accelCruise, ButtonType.decelCruise, ButtonType.resumeCruise) if not self.CP.pcmCruiseSpeed else
|
||||
(ButtonType.accelCruise, ButtonType.decelCruise),
|
||||
resume_button=(ButtonType.resumeCruise,) if not self.CP.pcmCruiseSpeed else
|
||||
|
||||
@@ -81,8 +81,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise)
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise)
|
||||
|
||||
if ret.cruiseState.available:
|
||||
if self.enable_mads:
|
||||
|
||||
@@ -227,8 +227,7 @@ class CarInterface(CarInterfaceBase):
|
||||
if any(b.type == ButtonType.accelCruise and b.pressed for b in self.CS.button_events):
|
||||
self.CS.accEnabled = True
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise)
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise)
|
||||
|
||||
if ret.cruiseState.available:
|
||||
if self.enable_mads:
|
||||
|
||||
@@ -269,8 +269,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise)
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise)
|
||||
|
||||
if ret.cruiseState.available:
|
||||
if self.enable_mads:
|
||||
|
||||
@@ -212,8 +212,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise)
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise)
|
||||
|
||||
if ret.cruiseState.available:
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
|
||||
@@ -558,12 +558,13 @@ class CarInterfaceBase(ABC):
|
||||
|
||||
return mads_enabled
|
||||
|
||||
def get_sp_v_cruise_non_pcm_state(self, cs_out, acc_enabled, button_events, vCruise,
|
||||
def get_sp_v_cruise_non_pcm_state(self, cs_out, vCruise,
|
||||
enable_buttons=(ButtonType.accelCruise, ButtonType.decelCruise),
|
||||
resume_button=(ButtonType.accelCruise, ButtonType.resumeCruise)):
|
||||
acc_enabled = self.CS.accEnabled
|
||||
|
||||
if cs_out.cruiseState.available:
|
||||
for b in button_events:
|
||||
for b in self.CS.button_events:
|
||||
if not self.CP.pcmCruise or not self.CP.pcmCruiseSpeed:
|
||||
if b.type in enable_buttons and not b.pressed:
|
||||
acc_enabled = True
|
||||
|
||||
@@ -47,8 +47,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise)
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise)
|
||||
|
||||
if ret.cruiseState.available:
|
||||
if self.enable_mads:
|
||||
|
||||
@@ -116,8 +116,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
self.CS.mads_enabled = self.get_sp_cruise_main_state(ret)
|
||||
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, self.CS.accEnabled,
|
||||
self.CS.button_events, c.vCruise,
|
||||
self.CS.accEnabled = self.get_sp_v_cruise_non_pcm_state(ret, c.vCruise,
|
||||
enable_buttons=(ButtonType.setCruise, ButtonType.resumeCruise))
|
||||
|
||||
if ret.cruiseState.available:
|
||||
|
||||
Reference in New Issue
Block a user