mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-03 12:32:06 +08:00
Revert "Dash Parity Gen2 ACC Pedal_Long"
This reverts commit 67ad32c0f5.
This commit is contained in:
@@ -172,13 +172,6 @@ static void gm_rx_hook(const CANPacket_t *to_push) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cruise check for ACC models with pedal interceptor - block stock ACC
|
||||
if ((addr == 0x1C4) && gm_has_acc && enable_gas_interceptor) {
|
||||
// When pedal interceptor is active on ACC models, ignore stock cruise state
|
||||
// to prevent conflicts between pedal interceptor and stock ACC
|
||||
cruise_engaged_prev = false;
|
||||
}
|
||||
|
||||
if (addr == 0xBD) {
|
||||
regen_braking = (GET_BYTE(to_push, 0) >> 4) != 0U;
|
||||
}
|
||||
@@ -199,12 +192,6 @@ static void gm_rx_hook(const CANPacket_t *to_push) {
|
||||
}
|
||||
generic_rx_checks(stock_ecu_detected);
|
||||
}
|
||||
// Cruise check for Gen2 Bolt (ASCMActiveCruiseControlStatus on bus 2)
|
||||
int addr = GET_ADDR(to_push);
|
||||
if ((addr == 0x370) && (GET_BUS(to_push) == 2U)) {
|
||||
bool cruise_engaged = (GET_BYTE(to_push, 2) >> 7) != 0U; // ACCCmdActive
|
||||
cruise_engaged_prev = cruise_engaged;
|
||||
}
|
||||
}
|
||||
|
||||
static bool gm_tx_hook(const CANPacket_t *to_send) {
|
||||
@@ -259,11 +246,6 @@ static bool gm_tx_hook(const CANPacket_t *to_send) {
|
||||
int button = (GET_BYTE(to_send, 5) >> 4) & 0x7U;
|
||||
|
||||
bool allowed_btn = (button == GM_BTN_CANCEL) && cruise_engaged_prev;
|
||||
// For ACC cars with pedal interceptor, allow cancel even if cruise_engaged_prev is false
|
||||
// (since we set it to false to prevent conflicts, but still need to cancel cruise)
|
||||
if (gm_hw == GM_CAM && enable_gas_interceptor && button == GM_BTN_CANCEL) {
|
||||
allowed_btn = true;
|
||||
}
|
||||
// For standard CC, allow spamming of SET / RESUME
|
||||
if (gm_cc_long) {
|
||||
allowed_btn |= cruise_engaged_prev && (button == GM_BTN_SET || button == GM_BTN_RESUME || button == GM_BTN_UNPRESS);
|
||||
@@ -290,7 +272,6 @@ static bool gm_tx_hook(const CANPacket_t *to_send) {
|
||||
tx = false;
|
||||
}
|
||||
}
|
||||
|
||||
return tx;
|
||||
}
|
||||
|
||||
@@ -310,14 +291,7 @@ static int gm_fwd_hook(int bus_num, int addr) {
|
||||
// block lkas message and acc messages if gm_cam_long, forward all others
|
||||
bool is_lkas_msg = (addr == 0x180);
|
||||
bool is_acc_msg = (addr == 0x315) || (addr == 0x2CB) || (addr == 0x370);
|
||||
bool block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long);
|
||||
|
||||
// Block camera 0x370 when using pedal longitudinal (dashboard control)
|
||||
// This is separate from gm_cam_long to avoid blocking 0x315/0x2CB
|
||||
if (gm_pedal_long && (addr == 0x370)) {
|
||||
block_msg = true;
|
||||
}
|
||||
|
||||
bool block_msg = is_lkas_msg || (is_acc_msg && gm_cam_long) || (addr == 0x184);
|
||||
if (!block_msg) {
|
||||
bus_fwd = 0;
|
||||
}
|
||||
@@ -359,9 +333,6 @@ static safety_config gm_init(uint16_t param) {
|
||||
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CC_LONG_TX_MSGS);
|
||||
} else if (gm_cam_long) {
|
||||
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_LONG_TX_MSGS);
|
||||
} else if (gm_pedal_long) {
|
||||
// Pedal long needs 0x370 for dashboard control
|
||||
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_LONG_TX_MSGS);
|
||||
} else {
|
||||
ret = BUILD_SAFETY_CFG(gm_rx_checks, GM_CAM_TX_MSGS);
|
||||
}
|
||||
|
||||
@@ -381,11 +381,6 @@ class CarController(CarControllerBase):
|
||||
can_sends.append(gmcan.create_buttons(self.packer_pt, CanBus.POWERTRAIN, (CS.buttons_counter + 1) % 4, CruiseButtons.DECEL_SET))
|
||||
if self.CP.enableGasInterceptor:
|
||||
can_sends.append(create_gas_interceptor_command(self.packer_pt, interceptor_gas_cmd, idx))
|
||||
# Dashboard display for PEDAL_LONG (matches BOLT_EUV behavior)
|
||||
if self.CP.flags & GMFlags.PEDAL_LONG.value:
|
||||
send_fcw = hud_alert == VisualAlert.fcw
|
||||
can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, CC.enabled,
|
||||
hud_v_cruise * CV.MS_TO_KPH, hud_control, send_fcw))
|
||||
if self.CP.carFingerprint not in CC_ONLY_CAR:
|
||||
friction_brake_bus = CanBus.CHASSIS
|
||||
# GM Camera exceptions
|
||||
|
||||
Reference in New Issue
Block a user