@@ -18,6 +18,7 @@ bool honda_moving = false;
18
18
bool honda_bosch_hardware = false;
19
19
bool honda_alt_brake_msg = false;
20
20
bool honda_fwd_brake = false;
21
+ bool bosch_ACC_allowed = false;
21
22
22
23
static void honda_rx_hook (CAN_FIFOMailBox_TypeDef * to_push ) {
23
24
@@ -81,7 +82,7 @@ static void honda_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
81
82
if (!gas_interceptor_detected ) {
82
83
if (addr == 0x17C ) {
83
84
int gas = GET_BYTE (to_push , 0 );
84
- if (gas && !(honda_gas_prev ) && long_controls_allowed ) {
85
+ if (gas && !(honda_gas_prev ) && long_controls_allowed && !( bosch_ACC_allowed ) ) {
85
86
controls_allowed = 0 ;
86
87
}
87
88
honda_gas_prev = gas ;
@@ -146,7 +147,7 @@ static int honda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
146
147
147
148
// disallow actuator commands if gas or brake (with vehicle moving) are pressed
148
149
// and the the latching controls_allowed flag is True
149
- int pedal_pressed = honda_gas_prev || (gas_interceptor_prev > HONDA_GAS_INTERCEPTOR_THRESHOLD ) ||
150
+ int pedal_pressed = (! bosch_ACC_allowed && honda_gas_prev ) || (gas_interceptor_prev > HONDA_GAS_INTERCEPTOR_THRESHOLD ) ||
150
151
(honda_brake_pressed_prev && honda_moving );
151
152
bool current_controls_allowed = controls_allowed && !(pedal_pressed );
152
153
@@ -168,6 +169,7 @@ static int honda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
168
169
169
170
// STEER: safety check
170
171
if ((addr == 0xE4 ) || (addr == 0x194 )) {
172
+ bosch_ACC_allowed = honda_bosch_hardware ;
171
173
if (!current_controls_allowed ) {
172
174
bool steer_applied = GET_BYTE (to_send , 0 ) | GET_BYTE (to_send , 1 );
173
175
if (steer_applied ) {
@@ -179,7 +181,7 @@ static int honda_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
179
181
// GAS: safety check
180
182
if (addr == 0x200 ) {
181
183
if (!current_controls_allowed || !long_controls_allowed ) {
182
- if (GET_BYTE (to_send , 0 ) || GET_BYTE (to_send , 1 )) {
184
+ if (! bosch_ACC_allowed && ( GET_BYTE (to_send , 0 ) || GET_BYTE (to_send , 1 ) )) {
183
185
tx = 0 ;
184
186
}
185
187
}
0 commit comments