From 9d87024b33d7876c4520e7576dcf8fd9993960df Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 20 Dec 2023 02:23:27 -0800 Subject: [PATCH] comments for all, add honda comments --- selfdrive/car/honda/fingerprints.py | 6 ++++++ selfdrive/debug/format_fingerprints.py | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/honda/fingerprints.py b/selfdrive/car/honda/fingerprints.py index 1a5a163b32..fe9e9273b7 100644 --- a/selfdrive/car/honda/fingerprints.py +++ b/selfdrive/car/honda/fingerprints.py @@ -3,6 +3,12 @@ from openpilot.selfdrive.car.honda.values import CAR Ecu = car.CarParams.Ecu +# Modified FW can be identified by the second dash being replaced by a comma +# For example: `b'39990-TVA,A150\x00\x00'` +# +# TODO: vsa is "essential" for fpv2 but doesn't appear on some CAR.FREED models + + FW_VERSIONS = { CAR.ACCORD: { (Ecu.programmedFuelInjection, 0x18da10f1, None): [ diff --git a/selfdrive/debug/format_fingerprints.py b/selfdrive/debug/format_fingerprints.py index 42ca414cf9..f6c0755730 100755 --- a/selfdrive/debug/format_fingerprints.py +++ b/selfdrive/debug/format_fingerprints.py @@ -25,9 +25,11 @@ from openpilot.selfdrive.car.{{brand}}.values import CAR Ecu = car.CarParams.Ecu {% endif %} +{% if comments +%} +{{ comments | join() }} +{% endif %} {% if FINGERPRINTS[brand] %} -{% if fingerprints_comments %}{{ fingerprints_comments | join() }}\n\n{% endif %} FINGERPRINTS = { {% for car, fingerprints in FINGERPRINTS[brand].items() %} CAR.{{car.name}}: [ @@ -70,10 +72,10 @@ def format_brand_fw_versions(brand, extra_fw_versions: None | dict[str, dict[tup 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] + 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, + f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, comments=comments, ECU_NAME=ECU_NAME, FINGERPRINTS=FINGERPRINTS, FW_VERSIONS=fw_versions))