Skip to content

Commit

Permalink
fix addr frequencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiasini committed Mar 5, 2020
1 parent e063b26 commit 2ef996f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions board/safety/safety_nissan.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const struct lookup_t NISSAN_LOOKUP_MAX_ANGLE = {
{3.3, 12, 32},
{540., 120., 23.}};

const int NISSAN_DEG_TO_CAN = 100;
const int NISSAN_DEG_TO_CAN = 100;

const AddrBus NISSAN_TX_MSGS[] = {{0x169, 0}, {0x20b, 2}};

AddrCheckStruct nissan_rx_checks[] = {
{.addr = {0x2}, .bus = 0, .expected_timestep = 100000U},
{.addr = {0x29a}, .bus = 0, .expected_timestep = 50000U},
{.addr = {0x1b6}, .bus = 1, .expected_timestep = 100000U},
{.addr = {0x2}, .bus = 0, .expected_timestep = 10000U},
{.addr = {0x29a}, .bus = 0, .expected_timestep = 20000U},
{.addr = {0x1b6}, .bus = 1, .expected_timestep = 10000U},
};
const int NISSAN_RX_CHECK_LEN = sizeof(nissan_rx_checks) / sizeof(nissan_rx_checks[0]);

Expand Down Expand Up @@ -135,7 +135,7 @@ static int nissan_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
int highest_desired_angle = nissan_desired_angle_last + ((nissan_desired_angle_last > 0) ? delta_angle_up : delta_angle_down);
int lowest_desired_angle = nissan_desired_angle_last - ((nissan_desired_angle_last >= 0) ? delta_angle_down : delta_angle_up);

// Limit maximum steering angle at current speed
// Limit maximum steering angle at current speed
int maximum_angle = ((int)interpolate(NISSAN_LOOKUP_MAX_ANGLE, nissan_speed));

if (highest_desired_angle > (maximum_angle * NISSAN_DEG_TO_CAN)) {
Expand Down

0 comments on commit 2ef996f

Please sign in to comment.