From fbb0fccb0ecb32c5ed04502cad0e7bc036c141e4 Mon Sep 17 00:00:00 2001 From: 1454 <19884453+1454@users.noreply.github.com> Date: Wed, 2 Sep 2026 09:30:51 -0400 Subject: [PATCH] Allow Silverado CC-long buttons at a complete stop. minEnableSpeed is 0, so a strict greater-than check never armed actuation at 0 m/s. Co-authored-by: Cursor --- opendbc_repo/opendbc/car/gm/carcontroller.py | 2 +- opendbc_repo/opendbc/car/gm/tests/test_gm.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/opendbc_repo/opendbc/car/gm/carcontroller.py index a8b99ac86..05d233b98 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/opendbc_repo/opendbc/car/gm/carcontroller.py @@ -172,7 +172,7 @@ def should_send_cc_button_spam(CP, CC, CS): return ( bool(CP.flags & GMFlags.CC_LONG.value) and CC.longActive and - CS.out.vEgo > CP.minEnableSpeed + CS.out.vEgo >= CP.minEnableSpeed ) diff --git a/opendbc_repo/opendbc/car/gm/tests/test_gm.py b/opendbc_repo/opendbc/car/gm/tests/test_gm.py index 42308fb04..b8cf95273 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_gm.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_gm.py @@ -628,6 +628,13 @@ class TestGMCarController: assert not should_send_cc_button_spam(SimpleNamespace(flags=GMFlags.CC_LONG.value, minEnableSpeed=10.0), cc, cs) assert not should_send_cc_button_spam(SimpleNamespace(flags=0, minEnableSpeed=10.0), cc, cs) + def test_cc_button_spam_allows_standstill_when_min_enable_is_zero(self): + cp = SimpleNamespace(flags=GMFlags.CC_LONG.value, minEnableSpeed=0.0) + cc = SimpleNamespace(longActive=True) + cs = SimpleNamespace(out=SimpleNamespace(vEgo=0.0, cruiseState=SimpleNamespace(enabled=False))) + + assert should_send_cc_button_spam(cp, cc, cs) + def test_volt_cc_redneck_spam_is_mirrored_to_camera_bus(self): packer = CANPacker(DBC[CAR.CHEVROLET_VOLT_CC][Bus.pt]) controller = SimpleNamespace(frame=int(0.3 / DT_CTRL), last_button_frame=0, apply_speed=0, malibu_button_phase=0)