diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index ab4c0cad1..6833a616d 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -483,7 +483,8 @@ class CarController(CarControllerBase): acc_engaged = CC.enabled # GasRegenCmdActive needs to be 1 to avoid cruise faults. It describes the ACC state, not actuation - can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, acc_engaged, at_full_stop)) + can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, acc_engaged, at_full_stop, + include_always_one3=self.CP.carFingerprint in kaofui_cars)) can_sends.append(gmcan.create_friction_brake_command(self.packer_ch, friction_brake_bus, self.apply_brake, idx, CC.enabled, near_stop, at_full_stop, self.CP)) diff --git a/selfdrive/car/gm/gmcan.py b/selfdrive/car/gm/gmcan.py index 14f913dda..565cf75fb 100644 --- a/selfdrive/car/gm/gmcan.py +++ b/selfdrive/car/gm/gmcan.py @@ -118,7 +118,7 @@ def create_adas_keepalive(bus): return [make_can_msg(0x409, dat, bus), make_can_msg(0x40a, dat, bus)] -def create_gas_regen_command(packer, bus, throttle, idx, enabled, at_full_stop): +def create_gas_regen_command(packer, bus, throttle, idx, enabled, at_full_stop, include_always_one3=False): values = { "GasRegenCmdActive": enabled, "RollingCounter": idx, @@ -127,8 +127,9 @@ def create_gas_regen_command(packer, bus, throttle, idx, enabled, at_full_stop): "GasRegenFullStopActive": at_full_stop, "GasRegenAlwaysOne": 1, "GasRegenAlwaysOne2": 1, - "GasRegenAlwaysOne3": 1, } + if include_always_one3: + values["GasRegenAlwaysOne3"] = 1 dat = packer.make_can_msg("ASCMGasRegenCmd", bus, values)[2] values["GasRegenChecksum"] = (((0xff - dat[1]) & 0xff) << 16) | \