Skip to content

Commit

Permalink
block IPAS in main toyota safety mode
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Apr 11, 2018
1 parent e7a2b3a commit 2e6f774
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions board/safety/safety_toyota.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ static int toyota_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
// Check if msg is sent on BUS 0
if (((to_send->RDTR >> 4) & 0xF) == 0) {

// no IPAS in non IPAS mode
if ((to_send->RIR>>21) == 0x266) return false;
if ((to_send->RIR>>21) == 0x167) return false;

// ACCEL: safety check on byte 1-2
if ((to_send->RIR>>21) == 0x343) {
int16_t desired_accel = ((to_send->RDLR & 0xFF) << 8) | ((to_send->RDLR >> 8) & 0xFF);
Expand Down

0 comments on commit 2e6f774

Please sign in to comment.