Skip to content

Commit

Permalink
Revert "remove fw exclusion"
Browse files Browse the repository at this point in the history
This reverts commit 0e3b47c.
  • Loading branch information
sshane committed Sep 28, 2023
1 parent 0e3b47c commit 42c55f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion selfdrive/car/toyota/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ def get_platform_codes(fw_versions: List[bytes]) -> Dict[bytes, Set[bytes]]:
return dict(codes)


def match_fw_to_car_fuzzy(live_fw_versions) -> Set[str]:
def match_fw_to_car_fuzzy(live_fw_versions, exclude_fw: dict[int, bytes] = None) -> Set[str]:
candidates = set()
if exclude_fw is None:
exclude_fw = dict()

for candidate, fws in FW_VERSIONS.items():
# Keep track of ECUs which pass all checks (platform codes, within sub-version range)
Expand All @@ -293,6 +295,10 @@ def match_fw_to_car_fuzzy(live_fw_versions) -> Set[str]:
if ecu[0] not in PLATFORM_CODE_ECUS:
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 = get_platform_codes(expected_versions)

Expand Down

0 comments on commit 42c55f0

Please sign in to comment.