Skip to content

Commit

Permalink
Subaru VIN filter for 10 second ECU init delay
Browse files Browse the repository at this point in the history
  • Loading branch information
martinl committed Apr 2, 2021
1 parent 2746f68 commit 8ab535d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions selfdrive/car/car_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ def fingerprint(logcan, sendcan):
cloudlog.warning("Getting VIN & FW versions")
_, vin = get_vin(logcan, sendcan, bus)

# Subaru needs 10sec delay before FW queries
for subaru_vin in ('JF1', 'JF2', '4S3', '4S4'):
if vin.startswith(subaru_vin):
cloudlog.warning("Waiting 10 seconds")
for wmi in SUBARU_WMI:
if vin.startswith(wmi):
cloudlog.warning("Subaru 10 second ECU init delay")
time.sleep(10)
break
car_fw = get_fw_versions(logcan, sendcan, bus)
Expand Down
5 changes: 3 additions & 2 deletions selfdrive/car/fw_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ def get_fw_versions(logcan, sendcan, bus, extra=None, timeout=0.1, debug=False,
print("Getting VIN took %.3f s" % (time.time() - t))
print()

for subaru_vin in ('JF1', 'JF2', '4S3', '4S4'):
if vin.startswith(subaru_vin):
for wmi in SUBARU_WMI:
if vin.startswith(wmi):
cloudlog.warning("Subaru 10 second ECU init delay")
time.sleep(10.)
break

Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/subaru/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,4 @@ class CAR:
}

PREGLOBAL_CARS = [CAR.FORESTER_PREGLOBAL, CAR.LEGACY_PREGLOBAL, CAR.OUTBACK_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018]
SUBARU_WMI = ['JF1', 'JF2', '4S3', '4S4']

0 comments on commit 8ab535d

Please sign in to comment.