Skip to content

Commit

Permalink
Remove unneeded code and move flag
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettpall committed Aug 10, 2024
1 parent c06460f commit c9205dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions selfdrive/car/gm/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ def update(self, CC, CS, now_nanos):
can_sends += gmcan.create_adas_keepalive(CanBus.POWERTRAIN)

# TODO: integrate this with the code block below?
if (
(self.CP.flags & GMFlags.PEDAL_LONG.value) # Always cancel stock CC when using pedal interceptor
or (self.CP.flags & GMFlags.CC_LONG.value and not CC.enabled) # Cancel stock CC if OP is not active
if ((self.CP.flags & GMFlags.PEDAL_LONG.value) # Always cancel stock CC when using pedal interceptor
) and CS.out.cruiseState.enabled:
if (self.frame - self.last_button_frame) * DT_CTRL > 0.04:
self.last_button_frame = self.frame
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):

elif candidate in CC_ONLY_CAR:
ret.experimentalLongitudinalAvailable = True
ret.flags |= GMFlags.CC_LONG.value
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_CC_LONG
if experimental_long:
ret.openpilotLongitudinalControl = True
ret.flags |= GMFlags.CC_LONG.value
ret.radarUnavailable = True
ret.minEnableSpeed = 24 * CV.MPH_TO_MS
ret.pcmCruise = True
Expand Down

0 comments on commit c9205dc

Please sign in to comment.