Skip to content

Commit

Permalink
Ford: common tx msg cleanup (#2129)
Browse files Browse the repository at this point in the history
* nice and clean!

* clean up
  • Loading branch information
sshane authored Jan 23, 2025
1 parent 3597071 commit 73dbcaa
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions board/safety/safety_ford.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,42 +363,33 @@ static safety_config ford_init(uint16_t param) {
{.msg = {{FORD_DesiredTorqBrk, 0, 8, .frequency = 50U}, { 0 }, { 0 }}},
};

#define FORD_COMMON_TX_MSGS \
{FORD_Steering_Data_FD1, 0, 8}, \
{FORD_Steering_Data_FD1, 2, 8}, \
{FORD_ACCDATA_3, 0, 8}, \
{FORD_Lane_Assist_Data1, 0, 8}, \
{FORD_IPMA_Data, 0, 8}, \

static const CanMsg FORD_CANFD_LONG_TX_MSGS[] = {
{FORD_Steering_Data_FD1, 0, 8},
{FORD_Steering_Data_FD1, 2, 8},
FORD_COMMON_TX_MSGS
{FORD_ACCDATA, 0, 8},
{FORD_ACCDATA_3, 0, 8},
{FORD_Lane_Assist_Data1, 0, 8},
{FORD_LateralMotionControl2, 0, 8},
{FORD_IPMA_Data, 0, 8},
};

static const CanMsg FORD_CANFD_STOCK_TX_MSGS[] = {
{FORD_Steering_Data_FD1, 0, 8},
{FORD_Steering_Data_FD1, 2, 8},
{FORD_ACCDATA_3, 0, 8},
{FORD_Lane_Assist_Data1, 0, 8},
FORD_COMMON_TX_MSGS
{FORD_LateralMotionControl2, 0, 8},
{FORD_IPMA_Data, 0, 8},
};

static const CanMsg FORD_STOCK_TX_MSGS[] = {
{FORD_Steering_Data_FD1, 0, 8},
{FORD_Steering_Data_FD1, 2, 8},
{FORD_ACCDATA_3, 0, 8},
{FORD_Lane_Assist_Data1, 0, 8},
FORD_COMMON_TX_MSGS
{FORD_LateralMotionControl, 0, 8},
{FORD_IPMA_Data, 0, 8},
};

static const CanMsg FORD_LONG_TX_MSGS[] = {
{FORD_Steering_Data_FD1, 0, 8},
{FORD_Steering_Data_FD1, 2, 8},
FORD_COMMON_TX_MSGS
{FORD_ACCDATA, 0, 8},
{FORD_ACCDATA_3, 0, 8},
{FORD_Lane_Assist_Data1, 0, 8},
{FORD_LateralMotionControl, 0, 8},
{FORD_IPMA_Data, 0, 8},
};

UNUSED(param);
Expand Down

0 comments on commit 73dbcaa

Please sign in to comment.