diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index aad6eec20..361dcde55 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -107,20 +107,17 @@ class CarState(CarStateBase): ret.brake = pt_cp.vl.get("ECMAcceleratorPos", {}).get("BrakePedalPos", 0) else: ret.brake = pt_cp.vl["ECMAcceleratorPos"]["BrakePedalPos"] - if self.CP.carFingerprint == CAR.CHEVROLET_BLAZER: - # Blazer can miss light taps on analog threshold; include digital brake switch. - ret.brakePressed = (pt_cp.vl["ECMEngineStatus"]["BrakePressed"] != 0) or (ret.brake >= 0.7) - elif self.CP.carFingerprint == CAR.CHEVROLET_MALIBU_CC: + if self.CP.carFingerprint == CAR.CHEVROLET_MALIBU_CC: # Malibu CC: keep strict opgm behavior using BrakePedalPos >= 8. ret.brakePressed = ret.brake >= 8 - elif (self.CP.flags & GMFlags.FORCE_BRAKE_C9.value) or (self.CP.networkLocation == NetworkLocation.fwdCamera): + elif (self.CP.flags & GMFlags.FORCE_BRAKE_C9.value) or ((self.CP.networkLocation == NetworkLocation.fwdCamera) and (self.CP.carFingerprint != CAR.CHEVROLET_BLAZER)): ret.brakePressed = pt_cp.vl["ECMEngineStatus"]["BrakePressed"] != 0 else: # Some Volt 2016-17 have loose brake pedal push rod retainers which causes the ECM to believe # that the brake is being intermittently pressed without user interaction. # To avoid a cruise fault we need to use a conservative brake position threshold # https://static.nhtsa.gov/odi/tsbs/2017/MC-10137629-9999.pdf - analog_thresh = 0.15 if (self.CP.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value) else 8 + analog_thresh = 0.10 if (self.CP.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value) else 8 ret.brakePressed = ret.brake >= analog_thresh # Regen braking is braking diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 955239c2a..4e6d2b6f7 100644 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -250,9 +250,9 @@ class CarInterface(CarInterfaceBase): ret.minEnableSpeed = -1. # engage speed is decided by pcm ret.minSteerSpeed = 7 * CV.MPH_TO_MS gm_safety_cfg.safetyParam |= Panda.FLAG_GM_HW_SDGM - # Use C9 brake bit on Blazer and SDGM variants that lack 0xBE (ECMAcceleratorPos), - # so panda brake_pressed source matches carstate on light taps. - if candidate == CAR.CHEVROLET_BLAZER or ACCELERATOR_POS_MSG not in fingerprint.get(CanBus.POWERTRAIN, {}): + # Use C9 brake bit on SDGM variants that lack 0xBE (ECMAcceleratorPos), + # so panda brake_pressed source matches carstate. + if ACCELERATOR_POS_MSG not in fingerprint.get(CanBus.POWERTRAIN, {}): gm_safety_cfg.safetyParam |= Panda.FLAG_GM_FORCE_BRAKE_C9 ret.flags |= GMFlags.FORCE_BRAKE_C9.value