Fix Misra 20.7 on safety code

master
Riccardo 2019-06-11 00:49:26 -07:00
parent 38f4288f1e
commit b7ed7adc71
1 changed files with 2 additions and 2 deletions

View File

@ -39,8 +39,8 @@ static void honda_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
// in these cases, this is used instead.
// most hondas: 0x17C bit 53
// accord, crv: 0x1BE bit 4
#define IS_USER_BRAKE_MSG(to_push) (!honda_alt_brake_msg ? to_push->RIR>>21 == 0x17C : to_push->RIR>>21 == 0x1BE)
#define USER_BRAKE_VALUE(to_push) (!honda_alt_brake_msg ? to_push->RDHR & 0x200000 : to_push->RDLR & 0x10)
#define IS_USER_BRAKE_MSG(to_push) (!honda_alt_brake_msg ? (to_push)->RIR>>21 == 0x17C : (to_push)->RIR>>21 == 0x1BE)
#define USER_BRAKE_VALUE(to_push) (!honda_alt_brake_msg ? (to_push)->RDHR & 0x200000 : (to_push)->RDLR & 0x10)
// exit controls on rising edge of brake press or on brake press when
// speed > 0
if (IS_USER_BRAKE_MSG(to_push)) {