From 0267dd4f989738f866485d241e50b61f46c902ef Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:07:38 -0600 Subject: [PATCH] kaofui --- panda/board/safety/safety_gm.h | 28 ++++++++++++++-------------- panda/python/__init__.py | 22 +++++++++++----------- selfdrive/car/gm/carcontroller.py | 9 ++++++++- selfdrive/car/gm/interface.py | 3 ++- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/panda/board/safety/safety_gm.h b/panda/board/safety/safety_gm.h index 50c5cde3d..f145fbbf1 100644 --- a/panda/board/safety/safety_gm.h +++ b/panda/board/safety/safety_gm.h @@ -52,7 +52,7 @@ const CanMsg GM_CAM_TX_MSGS[] = {{0x180, 0, 4}, {0x200, 0, 6}, {0x1E1, 0, 7}, {0 {0x1E1, 2, 7}, {0x184, 2, 8}}; // camera bus const CanMsg GM_CAM_LONG_TX_MSGS[] = {{0x180, 0, 4}, {0x315, 0, 5}, {0x2CB, 0, 8}, {0x370, 0, 6}, {0x200, 0, 6}, {0xBD, 0, 7}, {0x1F5, 0, 8}, // pt bus - {0x1E1, 2, 7}, {0x184, 2, 8}}; // camera bus + {0x315, 2, 5}, {0x1E1, 2, 7}, {0x184, 2, 8}}; // camera bus const CanMsg GM_SDGM_TX_MSGS[] = {{0x180, 0, 4}, {0x1E1, 0, 7}, {0xBD, 0, 7}, {0x1F5, 0, 8}, // pt bus {0x184, 2, 8}}; // camera bus @@ -74,17 +74,17 @@ RxCheck gm_rx_checks[] = { const uint16_t GM_PARAM_HW_CAM = 1; const uint16_t GM_PARAM_HW_CAM_LONG = 2; -const uint16_t GM_PARAM_HW_SDGM = 4; -const uint16_t GM_PARAM_CC_LONG = 8; -const uint16_t GM_PARAM_HW_ASCM_LONG = 16; -const uint16_t GM_PARAM_NO_CAMERA = 32; -const uint16_t GM_PARAM_NO_ACC = 64; -const uint16_t GM_PARAM_PEDAL_LONG = 128; // TODO: this can be inferred -const uint16_t GM_PARAM_PEDAL_INTERCEPTOR = 256; -const uint16_t GM_PARAM_BOLT_2017 = 512; -const uint16_t GM_PARAM_BOLT_2022_PEDAL = 1024; -const uint16_t GM_PARAM_ASCM_INT = 2048; -const uint16_t GM_PARAM_FORCE_BRAKE_C9 = 4096; +const uint16_t GM_PARAM_CC_LONG = 4; +const uint16_t GM_PARAM_HW_ASCM_LONG = 8; +const uint16_t GM_PARAM_NO_CAMERA = 16; +const uint16_t GM_PARAM_NO_ACC = 32; +const uint16_t GM_PARAM_PEDAL_LONG = 64; // TODO: this can be inferred +const uint16_t GM_PARAM_PEDAL_INTERCEPTOR = 128; +const uint16_t GM_PARAM_ASCM_INT = 256; +const uint16_t GM_PARAM_FORCE_BRAKE_C9 = 512; +const uint16_t GM_PARAM_HW_SDGM = 1024; +const uint16_t GM_PARAM_BOLT_2017 = 2048; +const uint16_t GM_PARAM_BOLT_2022_PEDAL = 4096; const uint16_t GM_PARAM_REMOTE_START_BOOTS_COMMA = 8192; enum { @@ -348,9 +348,9 @@ static int gm_fwd_hook(int bus_num, int addr) { static safety_config gm_init(uint16_t param) { gm_ascm_int = GET_FLAG(param, GM_PARAM_ASCM_INT); - if GET_FLAG(param, GM_PARAM_HW_CAM) { + if (GET_FLAG(param, GM_PARAM_HW_CAM)) { gm_hw = GM_CAM; - } else if GET_FLAG(param, GM_PARAM_HW_SDGM) { + } else if (GET_FLAG(param, GM_PARAM_HW_SDGM)) { gm_hw = GM_SDGM; } else { gm_hw = GM_ASCM; diff --git a/panda/python/__init__.py b/panda/python/__init__.py index 572750748..088ee8689 100644 --- a/panda/python/__init__.py +++ b/panda/python/__init__.py @@ -231,17 +231,17 @@ class Panda: FLAG_GM_HW_CAM = 1 FLAG_GM_HW_CAM_LONG = 2 - FLAG_GM_HW_SDGM = 4 - FLAG_GM_CC_LONG = 8 - FLAG_GM_HW_ASCM_LONG = 16 - FLAG_GM_NO_CAMERA = 32 - FLAG_GM_NO_ACC = 64 - FLAG_GM_PEDAL_LONG = 128 # TODO: This can be inferred - FLAG_GM_GAS_INTERCEPTOR = 256 - FLAG_GM_BOLT_2017 = 512 - FLAG_GM_BOLT_2022_PEDAL = 1024 - FLAG_GM_ASCM_INT = 2048 - FLAG_GM_FORCE_BRAKE_C9 = 4096 + FLAG_GM_CC_LONG = 4 + FLAG_GM_HW_ASCM_LONG = 8 + FLAG_GM_NO_CAMERA = 16 + FLAG_GM_NO_ACC = 32 + FLAG_GM_PEDAL_LONG = 64 # TODO: This can be inferred + FLAG_GM_GAS_INTERCEPTOR = 128 + FLAG_GM_ASCM_INT = 256 + FLAG_GM_FORCE_BRAKE_C9 = 512 + FLAG_GM_HW_SDGM = 1024 + FLAG_GM_BOLT_2017 = 2048 + FLAG_GM_BOLT_2022_PEDAL = 4096 FLAG_GM_REMOTE_START_BOOTS_COMMA = 8192 FLAG_FORD_LONG_CONTROL = 1 diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 30e5f1b05..be21f8182 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -162,6 +162,13 @@ class CarController(CarControllerBase): CAR.CHEVROLET_MALIBU_CC, CAR.CHEVROLET_MALIBU_HYBRID_CC, } + volt_like = { + CAR.CHEVROLET_VOLT, + CAR.CHEVROLET_VOLT_2019, + CAR.CHEVROLET_VOLT_ASCM, + CAR.CHEVROLET_VOLT_CAMERA, + CAR.CHEVROLET_VOLT_CC, + } # Planner-driven regen hold: gate by car support and OP long active, use commanded accel thresholds if (self.CP.enableGasInterceptor and self.CP.carFingerprint in CC_REGEN_PADDLE_CAR @@ -553,7 +560,7 @@ class CarController(CarControllerBase): CanBus.POWERTRAIN, self.malibu_cancel_phase, CS.steering_button_prefix)) self.malibu_cancel_phase = (self.malibu_cancel_phase + 1) % 4 self.malibu_cancel_frame += 1 - elif self.CP.carFingerprint in SDGM_CAR: + elif self.CP.carFingerprint in SDGM_CAR and self.CP.carFingerprint not in volt_like: can_sends.append(gmcan.create_buttons(self.packer_pt, CanBus.POWERTRAIN, CS.buttons_counter, CruiseButtons.CANCEL)) else: cancel_bus = CanBus.POWERTRAIN if (self.CP.enableGasInterceptor and self.CP.carFingerprint == CAR.CHEVROLET_BOLT_CC_2022_2023) else CanBus.CAMERA diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index f6748f7b2..073096aad 100644 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -560,7 +560,8 @@ class CarInterface(CarInterfaceBase): # TODO: verify 17 Volt can enable for the first time at a stop and allow for all GMs below_min_enable_speed = ret.vEgo < self.CP.minEnableSpeed or self.CS.moving_backward if below_min_enable_speed and not (ret.standstill and ret.brake >= 20 and - (self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.carFingerprint in SDGM_CAR)): + (self.CP.networkLocation == NetworkLocation.fwdCamera and + (self.CP.carFingerprint in VOLT_LIKE_CARS or self.CP.carFingerprint not in SDGM_CAR))): events.add(EventName.belowEngageSpeed) if ret.cruiseState.standstill and not self.CP.autoResumeSng: events.add(EventName.resumeRequired)