Skip to content

Commit

Permalink
fix cruise state bug
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Apr 29, 2022
1 parent 406f488 commit beac36e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion board/safety/safety_ford.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ static int ford_rx_hook(CANPacket_t *to_push) {
brake_pressed = ((GET_BYTE(to_push, 0) & 0x30U) >> 4) == 2U;

// Signal: CcStat_D_Actl
bool cruise_engaged = (GET_BYTE(to_push, 1) & 0x07U) == 5U;
unsigned int cruise_state = GET_BYTE(to_push, 1) & 0x07U;
bool cruise_engaged = cruise_state == 4U || cruise_state = 5U;

// Enter controls on rising edge of stock ACC, exit controls if stock ACC disengages
if (cruise_engaged && !cruise_engaged_prev) {
Expand Down

0 comments on commit beac36e

Please sign in to comment.