mirror of https://github.com/commaai/panda.git
Hyundai CAN FD: fix PCM cruise check (#1584)
* add pcm * fix * NA * explicitly check cruise status * comment and misra
This commit is contained in:
parent
8bd3e93813
commit
b25810670e
|
@ -226,7 +226,9 @@ static int hyundai_canfd_rx_hook(CANPacket_t *to_push) {
|
|||
if (valid && (bus == scc_bus)) {
|
||||
// cruise state
|
||||
if ((addr == 0x1a0) && !hyundai_longitudinal) {
|
||||
bool cruise_engaged = ((GET_BYTE(to_push, 8) >> 4) & 0x3U) != 0U;
|
||||
// 1=enabled, 2=driver override
|
||||
int cruise_status = ((GET_BYTE(to_push, 8) >> 4) & 0x7U);
|
||||
bool cruise_engaged = (cruise_status == 1) || (cruise_status == 2);
|
||||
hyundai_common_cruise_state_check(cruise_engaged);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue