diff --git a/board/safety/safety_honda.h b/board/safety/safety_honda.h index 80237dccbe3611..2004f1b5a3a009 100644 --- a/board/safety/safety_honda.h +++ b/board/safety/safety_honda.h @@ -103,7 +103,7 @@ static int honda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { // BRAKE: safety check if (addr == 0x1FA) { - int brake = (GET_BYTE(to_send, 0) << 2) + (GET_BYTE(to_send, 1) & 0x3); + int brake = (GET_BYTE(to_send, 0) << 2) + ((GET_BYTE(to_send, 1) >> 6) & 0x3); if (!current_controls_allowed || !long_controls_allowed) { if (brake != 0) { tx = 0; diff --git a/tests/safety/test_honda.py b/tests/safety/test_honda.py index f16030843c2a35..8e968328ac1239 100755 --- a/tests/safety/test_honda.py +++ b/tests/safety/test_honda.py @@ -64,7 +64,7 @@ def _gas_msg(self, gas): def _send_brake_msg(self, brake): to_send = libpandasafety_py.ffi.new('CAN_FIFOMailBox_TypeDef *') to_send[0].RIR = 0x1FA << 21 - to_send[0].RDLR = ((brake & 0x3) << 8) | ((brake & 0x3FF) >> 2) + to_send[0].RDLR = ((brake & 0x3) << 14) | ((brake & 0x3FF) >> 2) return to_send