mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-07 10:55:42 +08:00
No 0x130 on this HDA2, use ACCELERATOR alt gear signal instead
This commit is contained in:
@@ -26,6 +26,7 @@ class CarState(CarStateBase):
|
||||
|
||||
self.gear_msg_canfd = "GEAR_ALT" if CP.flags & HyundaiFlags.CANFD_ALT_GEARS else \
|
||||
"GEAR_ALT_2" if CP.flags & HyundaiFlags.CANFD_ALT_GEARS_2 else \
|
||||
"ACCELERATOR" if CP.flags & HyundaiFlags.CANFD_ALT_GEARS_3 else \
|
||||
"GEAR_SHIFTER"
|
||||
if CP.carFingerprint in CANFD_CAR:
|
||||
self.shifter_values = can_define.dv[self.gear_msg_canfd]["GEAR"]
|
||||
|
||||
@@ -44,6 +44,9 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.flags |= HyundaiFlags.CANFD_HDA2.value
|
||||
if 0x110 in fingerprint[CAN.CAM]:
|
||||
ret.flags |= HyundaiFlags.CANFD_HDA2_ALT_STEERING.value
|
||||
# Some HDA2 cars do not have 0x130, GEAR signal is in 0x35 as an alternative
|
||||
if 0x130 not in fingerprint[CAN.ECAN]:
|
||||
ret.flags |= HyundaiFlags.CANFD_ALT_GEARS_3.value
|
||||
else:
|
||||
# non-HDA2
|
||||
if 0x1cf not in fingerprint[CAN.ECAN]:
|
||||
|
||||
@@ -95,6 +95,8 @@ class HyundaiFlags(IntFlag):
|
||||
|
||||
MIN_STEER_32_MPH = 2 ** 23
|
||||
|
||||
CANFD_ALT_GEARS_3 = 2 ** 24
|
||||
|
||||
|
||||
class Footnote(Enum):
|
||||
CANFD = CarFootnote(
|
||||
|
||||
Reference in New Issue
Block a user