diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index f1f4c1a42db615..e17df5246df65c 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -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) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index b6ab598bfeeb9a..3318b5f5345fdb 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -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 diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py index a41901d32df881..f85187b5c6f31e 100644 --- a/selfdrive/car/subaru/values.py +++ b/selfdrive/car/subaru/values.py @@ -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']