From 6e11002886c61c9ccceaf08de1cede53e09dcf88 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 20 Dec 2023 01:26:31 -0800 Subject: [PATCH] standard name --- selfdrive/debug/format_fingerprints.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/debug/format_fingerprints.py b/selfdrive/debug/format_fingerprints.py index c9dcd4386e..b2bcc8d378 100755 --- a/selfdrive/debug/format_fingerprints.py +++ b/selfdrive/debug/format_fingerprints.py @@ -12,7 +12,7 @@ CARS = get_interface_attr('CAR') FW_VERSIONS = get_interface_attr('FW_VERSIONS') FINGERPRINTS = get_interface_attr('FINGERPRINTS') PLATFORM_TO_PYTHON_CAR_NAME = {brand: {car.value: car.name for car in CARS[brand]} for brand in CARS} -ECU_NUMBER_TO_NAME = {v: k for k, v in Ecu.schema.enumerants.items()} +ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()} FINGERPRINTS_PY_TEMPLATE = jinja2.Template(""" {%- if FINGERPRINTS[brand] %} @@ -46,7 +46,7 @@ FW_VERSIONS = { {% for car, _ in FW_VERSIONS[brand].items() %} CAR.{{PLATFORM_TO_PYTHON_CAR_NAME[brand][car]}}: { {% for key, fw_versions in FW_VERSIONS[brand][car].items() %} - (Ecu.{{ECU_NUMBER_TO_NAME[key[0]]}}, 0x{{"%0x" | format(key[1] | int)}}, \ + (Ecu.{{ECU_NAME[key[0]]}}, 0x{{"%0x" | format(key[1] | int)}}, \ {% if key[2] %}0x{{"%0x" | format(key[2] | int)}}{% else %}{{key[2]}}{% endif %}): [ {% for fw_version in fw_versions %} {{fw_version}}, @@ -62,7 +62,7 @@ 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_NUMBER_TO_NAME=ECU_NUMBER_TO_NAME, PLATFORM_TO_PYTHON_CAR_NAME=PLATFORM_TO_PYTHON_CAR_NAME, + f.write(FINGERPRINTS_PY_TEMPLATE.render(brand=brand, ECU_NAME=ECU_NAME, PLATFORM_TO_PYTHON_CAR_NAME=PLATFORM_TO_PYTHON_CAR_NAME, FINGERPRINTS=FINGERPRINTS, FW_VERSIONS=FW_VERSIONS))