can fingerprints comments

pull/30792/head
Shane Smiskol 2 years ago
parent 56bb9d2598
commit 9e97215e13
  1. 12
      selfdrive/car/chrysler/fingerprints.py
  2. 11
      selfdrive/debug/format_fingerprints.py

@ -4,6 +4,18 @@ from openpilot.selfdrive.car.chrysler.values import CAR
Ecu = car.CarParams.Ecu
# Unique CAN messages:
# Only the hybrids have 270: 8
# Only the gas have 55: 8, 416: 7
# For 564, All 2017 have length 4, whereas 2018-19 have length 8.
# For 924, Pacifica 2017 has length 3, whereas all 2018-19 have length 8.
# For 560, All 2019 have length 8, whereas all 2017-18 have length 4.
#
# Jeep Grand Cherokee unique messages:
# 2017 Trailhawk: 618: 8
# For 924, Trailhawk 2017 has length 3, whereas 2018 V6 has length 8.
FINGERPRINTS = {
CAR.PACIFICA_2017_HYBRID: [
{

@ -28,6 +28,7 @@ Ecu = car.CarParams.Ecu
{% endif %}
{% if FINGERPRINTS[brand] %}
{% if fingerprints_comments %}{{ fingerprints_comments | join() }}\n\n{% endif %}
FINGERPRINTS = {
{% for car, fingerprints in FINGERPRINTS[brand].items() %}
CAR.{{PLATFORM_TO_ENUM_NAME[car]}}: [
@ -61,9 +62,13 @@ FW_VERSIONS = {
def format_brand_fw_versions(brand):
with open(os.path.join(BASEDIR, f"selfdrive/car/{brand}/fingerprints.py"), "w") as f:
f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, ECU_NAME=ECU_NAME, PLATFORM_TO_ENUM_NAME=PLATFORM_TO_ENUM_NAME,
FINGERPRINTS=FINGERPRINTS, FW_VERSIONS=FW_VERSIONS))
fingerprints_file = os.path.join(BASEDIR, f"selfdrive/car/{brand}/fingerprints.py")
with open(fingerprints_file, "r") as f:
fingerprints_comments = [line for line in f.readlines() if line.startswith("#") and "noqa" not in line]
with open(fingerprints_file, "w") as f:
f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, fingerprints_comments=fingerprints_comments, ECU_NAME=ECU_NAME,
PLATFORM_TO_ENUM_NAME=PLATFORM_TO_ENUM_NAME, FINGERPRINTS=FINGERPRINTS, FW_VERSIONS=FW_VERSIONS))
if __name__ == "__main__":

Loading…
Cancel
Save