Skip to content

Commit bfe030a

Browse files
author
zhou jielei
committed
fix 326 signal problem
1 parent cfde3c3 commit bfe030a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

board/safety/safety_honda.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ static bool honda_alt_brake_msg = false;
3737
static bool honda_fwd_brake = false;
3838
static bool honda_bosch_long = false;
3939
static bool honda_bosch_radarless = false;
40+
41+
42+
static bool honda_addr_1a6_detect = false;
43+
4044
typedef enum {HONDA_NIDEC, HONDA_BOSCH} HondaHw;
4145
static HondaHw honda_hw = HONDA_NIDEC;
4246

@@ -87,8 +91,16 @@ static void honda_rx_hook(const CANPacket_t *to_push) {
8791

8892
// check ACC main state
8993
// 0x326 for all Bosch and some Nidec, 0x1A6 for some Nidec
90-
if ((addr == 0x326) || (addr == 0x1A6)) {
91-
acc_main_on = GET_BIT(to_push, ((addr == 0x326) ? 28U : 47U));
94+
// Odyssey RC5 japanese type use 0x1a6 for scm_buttons and main_on signal
95+
// But 0x326 also exist. So we need to ignore it.
96+
if (addr == 0x1A6) {
97+
honda_addr_1a6_detect = true;
98+
acc_main_on = GET_BIT(to_push, 47U);
99+
if (!acc_main_on) {
100+
controls_allowed = false;
101+
}
102+
} else if (addr == 0x326 && !honda_addr_1a6_detect) {
103+
acc_main_on = GET_BIT(to_push, 28U);
92104
if (!acc_main_on) {
93105
controls_allowed = false;
94106
}

0 commit comments

Comments
 (0)