Skip to content

Commit c2a0853

Browse files
committedAug 18, 2018
Hyundai safety: 593 also needs ot be modified
1 parent 594863c commit c2a0853

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎board/safety/safety_hyundai.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ int hyundai_giraffe_switch_1 = 0; // is giraffe switch 1 high?
44
static void hyundai_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
55

66
int bus = (to_push->RDTR >> 4) & 0xF;
7-
// 832 is lkas cmd. If it is on bus 0, then giraffe switch 1 is high
7+
// 832 is lkas cmd. If it is on bus 0, then giraffe switch 1 is high and we want stock
88
if ((to_push->RIR>>21) == 832 && (bus == 0)) {
99
hyundai_giraffe_switch_1 = 1;
1010
}
@@ -17,10 +17,10 @@ static void hyundai_init(int16_t param) {
1717

1818
static int hyundai_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
1919

20-
// forward cam to radar and viceversa if car is dsu-less, except lkas cmd and hud
20+
// forward camera to car and viceversa, excpet for lkas11 and mdps12
2121
if ((bus_num == 0 || bus_num == 2) && !hyundai_giraffe_switch_1) {
2222
int addr = to_fwd->RIR>>21;
23-
bool is_lkas_msg = (addr == 832 || addr == 1342) && bus_num == 2;
23+
bool is_lkas_msg = (addr == 832 && bus_num == 2) || (addr == 593 && bus_num == 0);
2424
return is_lkas_msg? -1 : (uint8_t)(~bus_num & 0x2);
2525
}
2626
return -1;

0 commit comments

Comments
 (0)