pan
This commit is contained in:
firestar5683
2026-06-27 15:21:02 -05:00
parent b811825b38
commit ee1f0bbe83
13 changed files with 12 additions and 67 deletions
-11
View File
@@ -680,17 +680,6 @@ class CarInterface(CarInterfaceBase):
# Reuse the no-camera safety bit as an ASCM Volt selector for the alternate EBCM brake path.
ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.FLAG_GM_NO_CAMERA.value
volt_ascm_sascm_stock_acc = (
candidate == CAR.CHEVROLET_VOLT_ASCM and
has_sascm and
not alpha_long and
ret.pcmCruise and
not ret.openpilotLongitudinalControl and
not ret.enableGasInterceptorDEPRECATED
)
if volt_ascm_sascm_stock_acc:
ret.safetyConfigs[0].safetyParam |= GMSafetyFlags.FLAG_GM_VOLT_ASCM_STOCK_ACC.value
try:
remote_start_boots_comma = params.get_bool("RemoteStartBootsComma")
except UnknownKeyName:
@@ -138,28 +138,6 @@ class TestGMInterface:
assert not car_params.startingState
assert car_params.startAccel == pytest.approx(0.0)
def test_volt_ascm_sascm_stock_long_sets_marker_only_with_alpha_long_off(self):
CarInterface = interfaces[CAR.CHEVROLET_VOLT_ASCM]
fingerprint = _empty_fingerprint()
fingerprint[0][0x2FF] = 8 # SASCM detected
stock_params = CarInterface.get_params(CAR.CHEVROLET_VOLT_ASCM, fingerprint, [], alpha_long=False,
is_release=False, docs=False, starpilot_toggles=_test_starpilot_toggles())
alpha_params = CarInterface.get_params(CAR.CHEVROLET_VOLT_ASCM, fingerprint, [], alpha_long=True,
is_release=False, docs=False, starpilot_toggles=_test_starpilot_toggles())
assert not stock_params.openpilotLongitudinalControl
assert stock_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_VOLT_ASCM_STOCK_ACC.value
assert alpha_params.openpilotLongitudinalControl
assert not alpha_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_VOLT_ASCM_STOCK_ACC.value
def test_volt_ascm_stock_long_marker_requires_sascm(self):
CarInterface = interfaces[CAR.CHEVROLET_VOLT_ASCM]
car_params = CarInterface.get_params(CAR.CHEVROLET_VOLT_ASCM, _empty_fingerprint(), [], alpha_long=False,
is_release=False, docs=False, starpilot_toggles=_test_starpilot_toggles())
assert not car_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_VOLT_ASCM_STOCK_ACC.value
def test_volt_cc_sparse_fingerprint_without_camera_sets_no_camera(self):
CarInterface = interfaces[CAR.CHEVROLET_VOLT_CC]
fingerprint = {
-3
View File
@@ -172,9 +172,6 @@ class GMSafetyFlags(IntFlag):
HW_SDGM = 1024
FLAG_GM_BOLT_2017 = 2048
FLAG_GM_BOLT_2022_PEDAL = 4096
# Context-specific alias for Volt ASCM + SASCM stock ACC. The Bolt pedal
# meaning remains active only on pedal/no-ACC paths in panda safety.
FLAG_GM_VOLT_ASCM_STOCK_ACC = 4096
FLAG_GM_REMOTE_START_BOOTS_COMMA = 8192
FLAG_GM_PANDA_3D1_SCHED = 16384
FLAG_GM_PANDA_PADDLE_SCHED = 32768
+10 -15
View File
@@ -62,7 +62,6 @@ static bool gm_bolt_2022_pedal = false;
static bool gm_alt_brake = false;
static bool gm_volt_auto_hold = false;
static bool gm_volt_one_pedal = false;
static bool gm_volt_ascm_stock_acc = false;
static bool gm_cc_long = false;
static bool gm_has_acc = true;
@@ -520,7 +519,7 @@ static bool gm_fwd_hook(int bus_num, int addr) {
bool is_acc_actuation_msg = (addr == 0x315U) || (addr == 0x2CBU);
block_msg = is_lkas_msg;
if (gm_cam_long || gm_pedal_long || gm_volt_ascm_stock_acc) {
if (gm_cam_long || gm_pedal_long) {
block_msg |= is_acc_status_msg;
}
if (gm_cam_long) {
@@ -707,8 +706,16 @@ static safety_config gm_init(uint16_t param) {
enable_gas_interceptor = GET_FLAG(param, GM_PARAM_PEDAL_INTERCEPTOR);
gm_force_ascm = GET_FLAG(param, GM_PARAM_HW_ASCM_LONG);
gm_force_brake_c9 = GET_FLAG(param, GM_PARAM_FORCE_BRAKE_C9);
const bool gm_bolt_2022_pedal_param = GET_FLAG(param, GM_PARAM_BOLT_2022_PEDAL);
gm_bolt_2022_pedal = GET_FLAG(param, GM_PARAM_BOLT_2022_PEDAL);
gm_remote_start_boots_comma = GET_FLAG(param, GM_PARAM_REMOTE_START_BOOTS_COMMA);
gm_panda_3d1_sched = GET_FLAG(param, GM_PARAM_PANDA_3D1_SCHED) && gm_pedal_long && !gm_has_acc && !gm_bolt_2022_pedal;
gm_panda_paddle_sched = GET_FLAG(param, GM_PARAM_PANDA_PADDLE_SCHED) && gm_pedal_long && enable_gas_interceptor;
// Reuse the paddle-scheduler bit as a stock-Volt auto-hold marker on non-pedal ACC paths.
gm_volt_auto_hold = GET_FLAG(param, GM_PARAM_PANDA_PADDLE_SCHED) && !gm_pedal_long && !gm_cc_long && gm_has_acc;
// Reuse the 3D1 scheduler bit as a stock-Volt one-pedal marker on non-pedal
// ACC paths. The actual 3D1 scheduler still requires pedal-long and no-ACC,
// so this stays isolated from the Bolt pedal path.
gm_volt_one_pedal = GET_FLAG(param, GM_PARAM_PANDA_3D1_SCHED) && !gm_pedal_long && !gm_cc_long && gm_has_acc;
gm_alt_brake = GET_FLAG(param, GM_PARAM_NO_CAMERA) && (gm_hw == GM_ASCM) && !gm_sdgm && !gm_ascm_int;
gm_3d1_spoof_valid = false;
@@ -739,18 +746,6 @@ static safety_config gm_init(uint16_t param) {
gm_cam_long = GET_FLAG(param, GM_PARAM_HW_CAM_LONG) && !gm_cc_long;
gm_pcm_cruise = (gm_hw == GM_CAM || gm_sdgm) && !gm_cam_long && !gm_force_ascm && !gm_pedal_long;
const bool gm_ascm_int_stock_cam = gm_ascm_int && (gm_hw == GM_CAM) && gm_pcm_cruise && !gm_cam_long && !gm_pedal_long && !gm_cc_long;
// On the stock-ASCM_INT camera path, reuse the Bolt pedal bit as a Volt
// ASCM + SASCM stock-ACC marker and strip its pedal-long meaning.
gm_volt_ascm_stock_acc = gm_ascm_int_stock_cam && gm_bolt_2022_pedal_param;
gm_bolt_2022_pedal = gm_bolt_2022_pedal_param && !gm_volt_ascm_stock_acc;
gm_panda_3d1_sched = GET_FLAG(param, GM_PARAM_PANDA_3D1_SCHED) && gm_pedal_long && !gm_has_acc && !gm_bolt_2022_pedal;
gm_panda_paddle_sched = GET_FLAG(param, GM_PARAM_PANDA_PADDLE_SCHED) && gm_pedal_long && enable_gas_interceptor;
// Reuse the paddle-scheduler bit as a stock-Volt auto-hold marker on non-pedal ACC paths.
gm_volt_auto_hold = GET_FLAG(param, GM_PARAM_PANDA_PADDLE_SCHED) && !gm_pedal_long && !gm_cc_long && gm_has_acc;
// Reuse the 3D1 scheduler bit as a stock-Volt one-pedal marker on non-pedal
// ACC paths. The actual 3D1 scheduler still requires pedal-long and no-ACC,
// so this stays isolated from the Bolt pedal path.
gm_volt_one_pedal = GET_FLAG(param, GM_PARAM_PANDA_3D1_SCHED) && !gm_pedal_long && !gm_cc_long && gm_has_acc;
const bool gm_ascm_int_no_accel_pos = gm_ascm_int && (gm_hw == GM_CAM) && gm_force_brake_c9;
// FLAG_GM_BOLT_2022_PEDAL is shared with Malibu Hybrid pedal-long. Requiring
// the paddle scheduler bit narrows this whitelist to the Gen2 Bolt pedal-long
@@ -297,20 +297,6 @@ def test_gm_ascm_int_stock_cam_f1_rx_pinning():
assert not safety.safety_config_valid()
def test_gm_volt_ascm_stock_acc_marker_blocks_camera_acc_status_forwarding():
safety = libsafety_py.libsafety
stock_ascm_int = GMSafetyFlags.HW_CAM | GMSafetyFlags.HW_ASCM_INT
marked_volt_ascm = stock_ascm_int | GMSafetyFlags.FLAG_GM_VOLT_ASCM_STOCK_ACC
safety.set_safety_hooks(CarParams.SafetyModel.gm, stock_ascm_int)
safety.init_tests()
assert safety.safety_fwd_hook(2, 0x370) == 0
safety.set_safety_hooks(CarParams.SafetyModel.gm, marked_volt_ascm)
safety.init_tests()
assert safety.safety_fwd_hook(2, 0x370) == -1
def test_gm_ascm_int_long_no_accel_pos_uses_stock_cam_rx_checks():
safety = libsafety_py.libsafety
safety.set_safety_hooks(CarParams.SafetyModel.gm, GMSafetyFlags.HW_CAM | GMSafetyFlags.HW_CAM_LONG |
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-b75b2168-DEBUG";
const uint8_t gitversion[19] = "DEV-199ef692-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-b75b2168-DEBUG
DEV-199ef692-DEBUG