diff --git a/opendbc/safety/board/can_declarations.h b/opendbc/safety/board/can_declarations.h index ebdf9cef..be2ef5c4 100644 --- a/opendbc/safety/board/can_declarations.h +++ b/opendbc/safety/board/can_declarations.h @@ -1,12 +1,7 @@ #pragma once #define CANPACKET_HEAD_SIZE 6U - -#ifdef CANFD - #define CANPACKET_DATA_SIZE_MAX 64U -#else - #define CANPACKET_DATA_SIZE_MAX 8U -#endif +#define CANPACKET_DATA_SIZE_MAX 64U typedef struct { unsigned char fd : 1; diff --git a/opendbc/safety/modes/hyundai_common.h b/opendbc/safety/modes/hyundai_common.h index 395fab39..69c73ea1 100644 --- a/opendbc/safety/modes/hyundai_common.h +++ b/opendbc/safety/modes/hyundai_common.h @@ -112,7 +112,6 @@ void hyundai_common_cruise_buttons_check(const int cruise_button, const bool mai } } -#ifdef CANFD uint32_t hyundai_common_canfd_compute_checksum(const CANPacket_t *msg) { int len = GET_LEN(msg); uint32_t address = msg->addr; @@ -137,4 +136,3 @@ uint32_t hyundai_common_canfd_compute_checksum(const CANPacket_t *msg) { return crc; } -#endif diff --git a/opendbc/safety/safety.h b/opendbc/safety/safety.h index f3b85615..e98d00ed 100644 --- a/opendbc/safety/safety.h +++ b/opendbc/safety/safety.h @@ -25,11 +25,7 @@ #include "opendbc/safety/modes/elm327.h" #include "opendbc/safety/modes/body.h" #include "opendbc/safety/modes/psa.h" - -// CAN-FD only safety modes -#ifdef CANFD #include "opendbc/safety/modes/hyundai_canfd.h" -#endif uint32_t GET_BYTES(const CANPacket_t *msg, int start, int len) { uint32_t ret = 0U; @@ -296,7 +292,6 @@ void gen_crc_lookup_table_8(uint8_t poly, uint8_t crc_lut[]) { } } -#ifdef CANFD void gen_crc_lookup_table_16(uint16_t poly, uint16_t crc_lut[]) { for (uint16_t i = 0; i < 256U; i++) { uint16_t crc = i << 8U; @@ -310,7 +305,6 @@ void gen_crc_lookup_table_16(uint16_t poly, uint16_t crc_lut[]) { crc_lut[i] = crc; } } -#endif // 1Hz safety function called by main. Now just a check for lagging safety messages void safety_tick(const safety_config *cfg) { @@ -409,9 +403,7 @@ int set_safety_hooks(uint16_t mode, uint16_t param) { {SAFETY_FORD, &ford_hooks}, {SAFETY_RIVIAN, &rivian_hooks}, {SAFETY_TESLA, &tesla_hooks}, -#ifdef CANFD {SAFETY_HYUNDAI_CANFD, &hyundai_canfd_hooks}, -#endif #ifdef ALLOW_DEBUG {SAFETY_PSA, &psa_hooks}, {SAFETY_SUBARU_PREGLOBAL, &subaru_preglobal_hooks}, diff --git a/opendbc/safety/safety_declarations.h b/opendbc/safety/safety_declarations.h index e759656c..31918c04 100644 --- a/opendbc/safety/safety_declarations.h +++ b/opendbc/safety/safety_declarations.h @@ -230,9 +230,7 @@ void update_sample(struct sample_t *sample, int sample_new); bool get_longitudinal_allowed(void); int ROUND(float val); void gen_crc_lookup_table_8(uint8_t poly, uint8_t crc_lut[]); -#ifdef CANFD void gen_crc_lookup_table_16(uint16_t poly, uint16_t crc_lut[]); -#endif bool steer_torque_cmd_checks(int desired_torque, int steer_req, const TorqueSteeringLimits limits); bool steer_angle_cmd_checks(int desired_angle, bool steer_control_enabled, const AngleSteeringLimits limits); bool steer_angle_cmd_checks_vm(int desired_angle, bool steer_control_enabled, const AngleSteeringLimits limits, diff --git a/opendbc/safety/tests/libsafety/SConscript b/opendbc/safety/tests/libsafety/SConscript index 057750eb..378fc5bd 100644 --- a/opendbc/safety/tests/libsafety/SConscript +++ b/opendbc/safety/tests/libsafety/SConscript @@ -22,7 +22,6 @@ env = Environment( '-std=gnu11', '-Wfatal-errors', '-Wno-pointer-to-int-cast', - '-DCANFD', ], CPPPATH=["#", "../../board/"], tools=["default", "compilation_db"], diff --git a/opendbc/safety/tests/misra/test_misra.sh b/opendbc/safety/tests/misra/test_misra.sh index 7fb2a6c1..216278c4 100755 --- a/opendbc/safety/tests/misra/test_misra.sh +++ b/opendbc/safety/tests/misra/test_misra.sh @@ -55,8 +55,8 @@ cppcheck() { PANDA_OPTS=" --enable=all --enable=unusedFunction --addon=misra" -printf "\n${GREEN}** Safety with CANFD **${NC}\n" -cppcheck $PANDA_OPTS -DCANFD $BASEDIR/opendbc/safety/tests/misra/main.c +printf "\n${GREEN}** Safety **${NC}\n" +cppcheck $PANDA_OPTS $BASEDIR/opendbc/safety/tests/misra/main.c printf "\n${GREEN}Success!${NC} took $SECONDS seconds\n"