THE SMOKING GUN

This commit is contained in:
firestar5683
2026-06-19 23:31:38 -05:00
parent 5d3d5a884b
commit 25a50a2ec3
4 changed files with 27 additions and 37 deletions
+3 -1
View File
@@ -912,7 +912,9 @@ class CarController(CarControllerBase):
# 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,
include_always_one3=self.CP.carFingerprint in kaofui_cars, use_volt_layout=self.is_volt))
include_always_one3=self.CP.carFingerprint in kaofui_cars,
use_volt_layout=self.is_volt and self.CP.carFingerprint != CAR.CHEVROLET_VOLT_2019,
use_generated_layout=self.CP.carFingerprint == CAR.CHEVROLET_VOLT_2019))
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,
allow_near_stop_mode=volt_one_pedal_braking))
+21 -22
View File
@@ -360,28 +360,27 @@ def create_prndl2_command(packer, bus, press_regen_paddle, CP):
prndl2_value = 5 if press_regen_paddle else 6
else:
prndl2_value = 7 if press_regen_paddle else 6
manual_mode = 1 if press_regen_paddle else 0
values = {
"Byte0": 0x0C,
"Byte1": 0x0C,
"Byte2": 0x00,
"PRNDL2": prndl2_value,
"Byte4": 0x00,
"ManualMode": manual_mode,
"TransmissionState": 1,
"Byte7": 0x00,
}
return packer.make_can_msg("ECMPRDNL2", bus, values)
dat = bytes([
0x0C,
0x0C,
0x00,
prndl2_value,
0x00,
0x02 if press_regen_paddle else 0x00,
0x01,
0x00,
])
return CanData(0x1F5, dat, bus)
def create_regen_paddle_command(packer, bus, press_regen_paddle):
values = {
"RegenPaddle": 2 if press_regen_paddle else 0,
"Byte1": 0,
"Byte2": 0,
"Byte3": 0,
"Byte4": 0,
"Byte5": 0,
"Byte6": 0,
}
return packer.make_can_msg("EBCMRegenPaddle", bus, values)
dat = bytes([
0x20 if press_regen_paddle else 0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
])
return CanData(0xBD, dat, bus)
@@ -62,13 +62,13 @@ class TestGMCan:
assert dat.hex() == "20000000000000"
def test_gas_regen_command_matches_starpilot_volt_2019(self):
def test_gas_regen_command_matches_generated_volt_2019_layout(self):
packer = CANPacker(DBC[CAR.CHEVROLET_VOLT_2019]["pt"])
addr, dat, bus = gmcan.create_gas_regen_command(packer, 0, 5000, 1, True, False, include_always_one3=True, use_volt_layout=True)
addr, dat, bus = gmcan.create_gas_regen_command(packer, 0, 5000, 1, True, False, include_always_one3=True, use_generated_layout=True)
assert addr == 0x2CB
assert bus == 0
assert dat.hex() == "41429c4000bd63bf"
assert dat.hex() == "41435c7000bca38f"
def test_gas_regen_command_matches_starpilot_volt_ascm(self):
packer = CANPacker(DBC[CAR.CHEVROLET_VOLT_ASCM]["pt"])
@@ -82,12 +82,6 @@ VAL_TABLE_ HandsOffSWDetectionMode 2 "Failed" 1 "Enabled" 0 "Disabled" ;
BO_ 189 EBCMRegenPaddle: 7 K17_EBCM
SG_ RegenPaddle : 7|4@0+ (1,0) [0|0] "" NEO
SG_ Byte1 : 15|8@0+ (1,0) [0|255] "" NEO
SG_ Byte2 : 23|8@0+ (1,0) [0|255] "" NEO
SG_ Byte3 : 31|8@0+ (1,0) [0|255] "" NEO
SG_ Byte4 : 39|8@0+ (1,0) [0|255] "" NEO
SG_ Byte5 : 47|8@0+ (1,0) [0|255] "" NEO
SG_ Byte6 : 55|8@0+ (1,0) [0|255] "" NEO
BO_ 190 ECMAcceleratorPos: 6 K20_ECM
SG_ BrakePedalPos : 15|8@0+ (1,0) [0|0] "sticky" NEO
@@ -198,14 +192,9 @@ BO_ 500 SportMode: 6 XXX
SG_ SportMode : 15|1@0+ (1,0) [0|1] "" XXX
BO_ 501 ECMPRDNL2: 8 K20_ECM
SG_ Byte0 : 7|8@0+ (1,0) [0|255] "" NEO
SG_ Byte1 : 15|8@0+ (1,0) [0|255] "" NEO
SG_ Byte2 : 23|8@0+ (1,0) [0|255] "" NEO
SG_ TransmissionState : 48|4@1+ (1,0) [0|7] "" NEO
SG_ PRNDL2 : 27|4@0+ (1,0) [0|255] "" NEO
SG_ Byte4 : 39|8@0+ (1,0) [0|255] "" NEO
SG_ ManualMode : 41|1@0+ (1,0) [0|1] "" NEO
SG_ Byte7 : 63|8@0+ (1,0) [0|255] "" NEO
BO_ 532 BRAKE_RELATED: 6 XXX
SG_ UserBrakePressure : 0|9@0+ (1,0) [0|511] "" XXX