This commit is contained in:
Maxime Desroches 2024-10-02 21:47:47 -07:00
parent 8de1323c97
commit 3c98cda5bb
1 changed files with 3 additions and 3 deletions

View File

@ -86,9 +86,9 @@ static void chrysler_rx_hook(const CANPacket_t *to_push) {
vehicle_moving = (GET_BYTE(to_push, 4) != 0U) || (GET_BYTE(to_push, 5) != 0U);
}
if ((chrysler_platform == CHRYSLER_PACIFICA) && (bus == 0) && (addr == 514)) {
bool speed_l = ((GET_BYTE(to_push, 0) << 4) != 0U) || ((GET_BYTE(to_push, 1) >> 4) != 0U);
bool speed_r = ((GET_BYTE(to_push, 2) << 4) != 0U) || ((GET_BYTE(to_push, 3) >> 4) != 0U);
vehicle_moving = speed_l || speed_r;
bool speed_l_non_zero = ((GET_BYTE(to_push, 0) << 4) != 0U) || ((GET_BYTE(to_push, 1) >> 4) != 0U);
bool speed_r_non_zero = ((GET_BYTE(to_push, 2) << 4) != 0U) || ((GET_BYTE(to_push, 3) >> 4) != 0U);
vehicle_moving = speed_l_non_zero || speed_r_non_zero;
}
// exit controls on rising edge of gas press