Hyundai CAN-FD: common PT bus function cleanup (#27397)

* Hyundai CAN-FD: common PT bus function cleanup

* use CP

* Update selfdrive/car/hyundai/hyundaicanfd.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
pull/27401/head
Jason Wen 2 years ago committed by GitHub
parent c7cc36d9ee
commit a20f07144b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      selfdrive/car/hyundai/interface.py

@ -2,6 +2,7 @@
from cereal import car
from panda import Panda
from common.conversions import Conversions as CV
from selfdrive.car.hyundai.hyundaicanfd import get_e_can_bus
from selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, Buttons
from selfdrive.car.hyundai.radar_interface import RADAR_START_ADDR
from selfdrive.car import STD_CARGO_KG, create_button_event, scale_tire_stiffness, get_safety_config
@ -247,8 +248,7 @@ class CarInterface(CarInterfaceBase):
# *** feature detection ***
if candidate in CANFD_CAR:
bus = 5 if ret.flags & HyundaiFlags.CANFD_HDA2 else 4
ret.enableBsm = 0x1e5 in fingerprint[bus]
ret.enableBsm = 0x1e5 in fingerprint[get_e_can_bus(ret)]
else:
ret.enableBsm = 0x58b in fingerprint[0]

Loading…
Cancel
Save