Skip to content

Commit

Permalink
Tesla: update ignition signal for Model 3/Y (#2153)
Browse files Browse the repository at this point in the history
update ignition signal
  • Loading branch information
sshane authored Feb 17, 2025
1 parent 2a4d3a9 commit b82c327
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions board/drivers/can_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ void ignition_can_hook(CANPacket_t *to_push) {
ignition_can_cnt = 0U;
}

// Tesla exception
if ((addr == 0x348) && (len == 8)) {
// GTW_status
ignition_can = (GET_BYTE(to_push, 0) & 0x1U) != 0U;
// Tesla Model 3/Y exception
if ((addr == 0x221) && (len == 8)) {
// VCFRONT_LVPowerState->VCFRONT_vehiclePowerState
int power_state = (GET_BYTE(to_push, 0) >> 5U) & 0x3U;
ignition_can = power_state == 0x3; // VEHICLE_POWER_STATE_DRIVE=3
ignition_can_cnt = 0U;
}

Expand Down

0 comments on commit b82c327

Please sign in to comment.