GM: passive on LKA-only cars
If LKA camera is still connected to powertrain.
@@ -22,7 +22,7 @@ const int GM_MAX_BRAKE = 350;
int gm_brake_prev = 0;
int gm_gas_prev = 0;
int gm_speed = 0;
-// silence everything if stock ECUs are still online
+// silence everything if stock car control ECUs are still online
int gm_ascm_detected = 0;
int gm_ignition_started = 0;
int gm_rt_torque_last = 0;
@@ -63,8 +63,11 @@ static void gm_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
gm_speed = to_push->RDLR & 0xFFFF;
}
- // check if stock ASCM ECU is still online
- if (bus_number == 0 && addr == 715) {
+ // Check if ASCM or LKA camera are online
+ // on powertrain bus.
+ // 384 = ASCMLKASteeringCmd
+ // 715 = ASCMGasRegenCmd
+ if (bus_number == 0 && (addr == 384 || addr == 715)) {
gm_ascm_detected = 1;
controls_allowed = 0;
}
