Skip to content

Commit

Permalink
Honda: remove duplicated relay transition time check (commaai#1544)
Browse files Browse the repository at this point in the history
already checked
  • Loading branch information
sshane authored Aug 3, 2023
1 parent 1154eb2 commit 3e429ac
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions board/safety/safety_honda.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,18 @@ static int honda_rx_hook(CANPacket_t *to_push) {
int bus_rdr_car = (honda_hw == HONDA_BOSCH) ? 0 : 2; // radar bus, car side
bool stock_ecu_detected = false;

if (safety_mode_cnt > RELAY_TRNS_TIMEOUT) {
// If steering controls messages are received on the destination bus, it's an indication
// that the relay might be malfunctioning
if ((addr == 0xE4) || (addr == 0x194)) {
if (((honda_hw != HONDA_NIDEC) && (bus == bus_rdr_car)) || ((honda_hw == HONDA_NIDEC) && (bus == 0))) {
stock_ecu_detected = true;
}
}
// If Honda Bosch longitudinal mode is selected we need to ensure the radar is turned off
// Verify this by ensuring ACC_CONTROL (0x1DF) is not received on the PT bus
if (honda_bosch_long && !honda_bosch_radarless && (bus == pt_bus) && (addr == 0x1DF)) {
// If steering controls messages are received on the destination bus, it's an indication
// that the relay might be malfunctioning
if ((addr == 0xE4) || (addr == 0x194)) {
if (((honda_hw != HONDA_NIDEC) && (bus == bus_rdr_car)) || ((honda_hw == HONDA_NIDEC) && (bus == 0))) {
stock_ecu_detected = true;
}
}
// If Honda Bosch longitudinal mode is selected we need to ensure the radar is turned off
// Verify this by ensuring ACC_CONTROL (0x1DF) is not received on the PT bus
if (honda_bosch_long && !honda_bosch_radarless && (bus == pt_bus) && (addr == 0x1DF)) {
stock_ecu_detected = true;
}

generic_rx_checks(stock_ecu_detected);
}
Expand Down

0 comments on commit 3e429ac

Please sign in to comment.