mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-24 16:32:08 +08:00
Gap Adjust Cruise: Fix unnecessary I/O (#287)
This commit is contained in:
@@ -472,9 +472,10 @@ class CarInterfaceBase(ABC):
|
||||
|
||||
def toggle_gac(self, cs_out, CS, gac_button, gac_min, gac_max, gac_default, inc_dec):
|
||||
if not self.CP.openpilotLongitudinalControl:
|
||||
CS.gac_tr = 2
|
||||
CS.gac_tr_cluster = gac_default
|
||||
put_nonblocking("LongitudinalPersonality", "2")
|
||||
if CS.gac_tr != 2:
|
||||
CS.gac_tr = 2
|
||||
put_nonblocking("LongitudinalPersonality", "2")
|
||||
return cs_out, CS
|
||||
if gac_button:
|
||||
self.gac_button_counter += 1
|
||||
|
||||
@@ -324,7 +324,9 @@ class CarInterface(CarInterfaceBase):
|
||||
self.CS.madsEnabled = self.get_acc_mads(ret.cruiseState.enabled, self.CS.accEnabled, self.CS.madsEnabled)
|
||||
if not self.CP.openpilotLongitudinalControl:
|
||||
self.CS.gac_tr_cluster = 3
|
||||
put_nonblocking("LongitudinalPersonality", "2")
|
||||
if CS.gac_tr != 2:
|
||||
CS.gac_tr = 2
|
||||
put_nonblocking("LongitudinalPersonality", "2")
|
||||
else:
|
||||
gap_dist_button = bool(self.CS.gap_dist_button)
|
||||
if gap_dist_button:
|
||||
|
||||
Reference in New Issue
Block a user