From 74d58ab0d68acab7fead658d3c56e03d5792f0ab Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Sun, 13 Nov 2022 21:13:46 -0800 Subject: [PATCH] GM: match stock enabling behavior (#26442) * add first draft enable button timeout * use allow_enable * it doesn't count if brakePressed * enable on rising edge of resume (matches stock) * not today * add comment describing the fault this avoids * cleaner * handle incrementing speed * rename * add test for not changing speed if enabled changes mid-press * spacey * ugh * bumpo * need this to fix a fault (draft) * already have * this should be cancel * fine to do for all * fine to do for all * bump * bumpo * bump to master * Update selfdrive/car/gm/interface.py * Update selfdrive/car/gm/interface.py * Update ref_commit old-commit-hash: 15383d30161de7646edf770153b0f81d15338c54 --- panda | 2 +- selfdrive/car/gm/interface.py | 6 +++++- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/panda b/panda index 0096d0c4fc..c0632cd32b 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 0096d0c4fc50d199ca46c6fe40479e1547408aed +Subproject commit c0632cd32b78279dfbb3ce28c7a10ded8090d40f diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index c41aac0ae0..eb5ab7329a 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -218,9 +218,13 @@ class CarInterface(CarInterfaceBase): ret.buttonEvents = buttonEvents + # The ECM allows enabling on falling edge of set, but only rising edge of resume events = self.create_common_events(ret, extra_gears=[GearShifter.sport, GearShifter.low, GearShifter.eco, GearShifter.manumatic], - pcm_enable=self.CP.pcmCruise) + pcm_enable=self.CP.pcmCruise, enable_buttons=(ButtonType.decelCruise,)) + if not self.CP.pcmCruise: + if any(b.type == ButtonType.accelCruise and b.pressed for b in ret.buttonEvents): + events.add(EventName.buttonEnable) # Enabling at a standstill with brake is allowed # TODO: verify 17 Volt can enable for the first time at a stop and allow for all GMs diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 55788155b5..f35e23d45f 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -2ac5ecc79218aad0319e02218b050319a180e957 +aa2d370836588fd80b648dbed8d156765ec804d5