From 36fdf50f98b59da2aeb32a9000113ca3cc4a6616 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 2 Jun 2022 22:01:37 -0700 Subject: [PATCH 1/2] handle bad VIN (#24712) --- selfdrive/car/car_helpers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 85fcfa1fad..fc441ac2e7 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -116,6 +116,9 @@ def fingerprint(logcan, sendcan): vin = VIN_UNKNOWN exact_fw_match, fw_candidates, car_fw = True, set(), [] + if len(vin) != 17: + cloudlog.event("Malformed VIN", vin=vin, error=True) + vin = VIN_UNKNOWN cloudlog.warning("VIN %s", vin) Params().put("CarVin", vin) From 40deea7d7bdd2176f897c203657e45bfd7fd1fcc Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 2 Jun 2022 22:06:01 -0700 Subject: [PATCH 2/2] Honda: fix enabling before PCM (#24715) * Don't enable for pcmCruise Honda * make it a no entry as well * do in another PR --- selfdrive/car/__init__.py | 7 ++++--- selfdrive/car/honda/interface.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index 806a060f97..c77e40daaf 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -24,12 +24,13 @@ def create_button_event(cur_but: int, prev_but: int, buttons_dict: Dict[int, cap return be -def create_button_enable_events(buttonEvents: capnp.lib.capnp._DynamicListBuilder) -> List[int]: +def create_button_enable_events(buttonEvents: capnp.lib.capnp._DynamicListBuilder, pcm_cruise: bool = False) -> List[int]: events = [] for b in buttonEvents: # do enable on both accel and decel buttons - if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: - events.append(EventName.buttonEnable) + if not pcm_cruise: + if b.type in (ButtonType.accelCruise, ButtonType.decelCruise) and not b.pressed: + events.append(EventName.buttonEnable) # do disable on button down if b.type == ButtonType.cancel and b.pressed: events.append(EventName.buttonCancel) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 5b97b3389f..84437b4f40 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -367,7 +367,7 @@ class CarInterface(CarInterfaceBase): events.add(EventName.manualRestart) # handle button presses - events.events.extend(create_button_enable_events(ret.buttonEvents)) + events.events.extend(create_button_enable_events(ret.buttonEvents, self.CP.pcmCruise)) ret.events = events.to_msg()