Revert "Revert "remove fw exclusion""

This reverts commit 42c55f006a.
pull/28641/head
Shane Smiskol 2 years ago
parent 3aeea90836
commit 0f87423342
  1. 8
      selfdrive/car/toyota/values.py

@ -280,10 +280,8 @@ def get_platform_codes(fw_versions: List[bytes]) -> Dict[bytes, Set[bytes]]:
return dict(codes) return dict(codes)
def match_fw_to_car_fuzzy(live_fw_versions, exclude_fw: dict[int, bytes] = None) -> Set[str]: def match_fw_to_car_fuzzy(live_fw_versions) -> Set[str]:
candidates = set() candidates = set()
if exclude_fw is None:
exclude_fw = dict()
for candidate, fws in FW_VERSIONS.items(): for candidate, fws in FW_VERSIONS.items():
# Keep track of ECUs which pass all checks (platform codes, within sub-version range) # Keep track of ECUs which pass all checks (platform codes, within sub-version range)
@ -295,10 +293,6 @@ def match_fw_to_car_fuzzy(live_fw_versions, exclude_fw: dict[int, bytes] = None)
if ecu[0] not in PLATFORM_CODE_ECUS: if ecu[0] not in PLATFORM_CODE_ECUS:
continue continue
# ignore FW if in exclude dict and there's more than one fw
expected_versions = [fw for fw in expected_versions if addr not in exclude_fw or
(fw != exclude_fw[addr] or len(expected_versions) == 1)]
# Expected platform codes & versions # Expected platform codes & versions
expected_platform_codes = get_platform_codes(expected_versions) expected_platform_codes = get_platform_codes(expected_versions)

Loading…
Cancel
Save