mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-09 08:24:27 +08:00
MADS: Honda Nidec: Fix enforce cruise cancel with stock PCM
This commit is contained in:
@@ -238,7 +238,7 @@ class CarState(CarStateBase):
|
||||
ret.brakePressed = (cp.vl["POWERTRAIN_DATA"]["BRAKE_PRESSED"] != 0) or self.brake_switch_active
|
||||
|
||||
ret.brake = cp.vl["VSA_STATUS"]["USER_BRAKE"]
|
||||
ret.cruiseState.enabled = cp.vl["POWERTRAIN_DATA"]["ACC_STATUS"] != 0
|
||||
ret.cruiseState.enabled = self.pcm_cruise_enabled = cp.vl["POWERTRAIN_DATA"]["ACC_STATUS"] != 0
|
||||
ret.cruiseState.available = bool(cp.vl[self.main_on_sig_msg]["MAIN_ON"])
|
||||
|
||||
# Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models
|
||||
|
||||
@@ -380,7 +380,7 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.CP.pcmCruise and self.CP.minEnableSpeed > 0 and self.CP.pcmCruiseSpeed:
|
||||
if ret.gasPressed and not ret.cruiseState.enabled:
|
||||
self.CS.accEnabled = False
|
||||
self.CS.accEnabled = ret.cruiseState.enabled or self.CS.accEnabled
|
||||
self.CS.accEnabled = self.CS.pcm_cruise_enabled
|
||||
|
||||
ret, self.CS = self.get_sp_common_state(ret, self.CS,
|
||||
min_enable_speed_pcm=(self.CP.pcmCruise and self.CP.minEnableSpeed > 0 and self.CP.pcmCruiseSpeed),
|
||||
|
||||
@@ -757,6 +757,7 @@ class CarStateBase(ABC):
|
||||
self.mads_enabled = False
|
||||
self.prev_mads_enabled = False
|
||||
self.control_initialized = False
|
||||
self.pcm_cruise_enabled = False
|
||||
self.gap_dist_button = 0
|
||||
self.gac_tr = int(self.param_s.get("LongitudinalPersonality"))
|
||||
self.gac_tr_cluster = clip(int(self.param_s.get("LongitudinalPersonality")), 1, 3)
|
||||
|
||||
Reference in New Issue
Block a user