diff --git a/selfdrive/car/toyota/tests/print_platform_codes.py b/selfdrive/car/toyota/tests/print_platform_codes.py index e61f681b6d..94badc5cde 100755 --- a/selfdrive/car/toyota/tests/print_platform_codes.py +++ b/selfdrive/car/toyota/tests/print_platform_codes.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 from cereal import car -from openpilot.selfdrive.car.toyota.values import FW_VERSIONS, get_platform_codes +from openpilot.selfdrive.car.toyota.values import FW_VERSIONS, PLATFORM_CODE_ECUS, get_platform_codes Ecu = car.CarParams.Ecu ECU_NAME = {v: k for k, v in Ecu.schema.enumerants.items()} @@ -10,12 +10,12 @@ if __name__ == "__main__": print() print(car_model) for ecu in sorted(ecus, key=lambda x: int(x[0])): - # if ecu[0] not in PLATFORM_CODE_ECUS: - # continue + if ecu[0] not in PLATFORM_CODE_ECUS: + continue platform_codes = get_platform_codes(ecus[ecu]) codes = {code for code, _ in platform_codes} dates = {date for _, date in platform_codes if date is not None} print(f' (Ecu.{ECU_NAME[ecu[0]]}, {hex(ecu[1])}, {ecu[2]}):') print(f' Codes: {codes}') - print(f' Dates: {dates}') + print(f' Versions: {dates}') diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index ed33fe15bd..645637a4b9 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -354,6 +354,7 @@ LONG_FW_PATTERN = re.compile(b'(?P[A-Z0-9]{5})(?P[A-Z0-9]{2})(?P FW_LEN_CODE = re.compile(b'^[\x01-\x05]') # 5 chunks max. highest seen is 3 chunks, 16 bytes each # List of ECUs expected to have platform codes +# TODO: use hybrid ECU, splits many similar ICE and hybrid variants PLATFORM_CODE_ECUS = [Ecu.abs, Ecu.engine, Ecu.eps, Ecu.dsu, Ecu.fwdCamera, Ecu.fwdRadar] # Some ECUs that use KWP2000 have their FW versions on non-standard data identifiers.