diff --git a/opendbc_repo/opendbc/car/gm/interface.py b/opendbc_repo/opendbc/car/gm/interface.py index 582d8c884..10b67084f 100755 --- a/opendbc_repo/opendbc/car/gm/interface.py +++ b/opendbc_repo/opendbc/car/gm/interface.py @@ -659,7 +659,6 @@ class CarInterface(CarInterfaceBase): volt_stock_auto_hold_safety = ( gm_auto_hold and - not ret.openpilotLongitudinalControl and candidate in { CAR.CHEVROLET_VOLT, CAR.CHEVROLET_VOLT_2019, @@ -668,8 +667,10 @@ class CarInterface(CarInterfaceBase): } ) if volt_stock_auto_hold_safety: - # Reuse the paddle-scheduler safety bit as a stock-Volt auto-hold marker on - # non-pedal paths. The scheduler logic remains inactive without pedal-long. + # Reuse the paddle-scheduler safety bit as a Volt auto-hold marker on + # non-pedal paths. Hold can run while OP longitudinal is configured but + # not currently active, so the bit must be present regardless of the + # current long-control mode. ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.FLAG_GM_PANDA_PADDLE_SCHED.value use_panda_3d1_sched = ( diff --git a/opendbc_repo/opendbc/car/gm/tests/test_gm.py b/opendbc_repo/opendbc/car/gm/tests/test_gm.py index d342ef27d..b1d115db9 100644 --- a/opendbc_repo/opendbc/car/gm/tests/test_gm.py +++ b/opendbc_repo/opendbc/car/gm/tests/test_gm.py @@ -132,6 +132,22 @@ class TestGMInterface: assert "ECMAcceleratorPos" not in pt_parser.vl assert "EBCMBrakePedalPosition" in pt_parser.vl + def test_volt_auto_hold_sets_stock_hold_safety_bit_with_op_long_enabled(self): + CarInterface = interfaces[CAR.CHEVROLET_VOLT_ASCM] + fingerprint = _empty_fingerprint() + fingerprint[0][0x2FF] = 8 + + params = Params() + try: + params.put_bool("GMAutoHold", True) + car_params = CarInterface.get_params(CAR.CHEVROLET_VOLT_ASCM, fingerprint, [], alpha_long=True, is_release=False, + docs=False, starpilot_toggles=_test_starpilot_toggles()) + finally: + params.remove("GMAutoHold") + + assert car_params.openpilotLongitudinalControl + assert car_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_PANDA_PADDLE_SCHED.value + @parameterized.expand(VOLT_CARS) def test_volt_bsm_is_enabled_without_fingerprint_match(self, car_model): CarInterface = interfaces[car_model]