mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 00:43:54 +08:00
Ford: use more reliable gear message (#32886)
* todo * nope * not this one * yep * passes * clean up * not used! * oop * update refs
This commit is contained in:
@@ -15,7 +15,7 @@ class CarState(CarStateBase):
|
||||
super().__init__(CP)
|
||||
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
|
||||
if CP.transmissionType == TransmissionType.automatic:
|
||||
self.shifter_values = can_define.dv["Gear_Shift_by_Wire_FD1"]["TrnRng_D_RqGsm"]
|
||||
self.shifter_values = can_define.dv["PowertrainData_10"]["TrnRng_D_Rq"]
|
||||
|
||||
self.vehicle_sensors_valid = False
|
||||
|
||||
@@ -69,7 +69,7 @@ class CarState(CarStateBase):
|
||||
|
||||
# gear
|
||||
if self.CP.transmissionType == TransmissionType.automatic:
|
||||
gear = self.shifter_values.get(cp.vl["Gear_Shift_by_Wire_FD1"]["TrnRng_D_RqGsm"])
|
||||
gear = self.shifter_values.get(cp.vl["PowertrainData_10"]["TrnRng_D_Rq"])
|
||||
ret.gearShifter = self.parse_gear_shifter(gear)
|
||||
elif self.CP.transmissionType == TransmissionType.manual:
|
||||
ret.clutchPressed = cp.vl["Engine_Clutch_Data"]["CluPdlPos_Pc_Meas"] > 0
|
||||
@@ -139,7 +139,7 @@ class CarState(CarStateBase):
|
||||
|
||||
if CP.transmissionType == TransmissionType.automatic:
|
||||
messages += [
|
||||
("Gear_Shift_by_Wire_FD1", 10),
|
||||
("PowertrainData_10", 10),
|
||||
]
|
||||
elif CP.transmissionType == TransmissionType.manual:
|
||||
messages += [
|
||||
|
||||
@@ -1 +1 @@
|
||||
8737e368e17f859291164286feb4246e00c0b4a5
|
||||
f6ff3601bd0496e78d8bc3b019d58bb7739f096b
|
||||
Reference in New Issue
Block a user