Skip to content

Commit bc83987

Browse files
authored
Ford CAN FD: enable safety in release (#1896)
CAN FD out of ALLOW_DEBUG
1 parent 46fa666 commit bc83987

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

opendbc/safety/safety/safety_ford.h

+5-7
Original file line numberDiff line numberDiff line change
@@ -398,26 +398,24 @@ static safety_config ford_init(uint16_t param) {
398398
{FORD_LateralMotionControl, 0, 8},
399399
};
400400

401-
UNUSED(param);
401+
const uint16_t FORD_PARAM_CANFD = 2;
402+
ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD);
403+
404+
ford_longitudinal = false;
405+
402406
#ifdef ALLOW_DEBUG
403407
const uint16_t FORD_PARAM_LONGITUDINAL = 1;
404-
const uint16_t FORD_PARAM_CANFD = 2;
405408
ford_longitudinal = GET_FLAG(param, FORD_PARAM_LONGITUDINAL);
406-
ford_canfd = GET_FLAG(param, FORD_PARAM_CANFD);
407409
#endif
408410

409411
// Longitudinal is the default for CAN, and optional for CAN FD w/ ALLOW_DEBUG
410412
ford_longitudinal = !ford_canfd || ford_longitudinal;
411413

412414
safety_config ret;
413-
// FIXME: cppcheck thinks that ford_canfd is always false. This is not true
414-
// if ALLOW_DEBUG is defined but cppcheck is run without ALLOW_DEBUG
415-
// cppcheck-suppress knownConditionTrueFalse
416415
if (ford_canfd) {
417416
ret = ford_longitudinal ? BUILD_SAFETY_CFG(ford_rx_checks, FORD_CANFD_LONG_TX_MSGS) : \
418417
BUILD_SAFETY_CFG(ford_rx_checks, FORD_CANFD_STOCK_TX_MSGS);
419418
} else {
420-
// cppcheck-suppress knownConditionTrueFalse
421419
ret = ford_longitudinal ? BUILD_SAFETY_CFG(ford_rx_checks, FORD_LONG_TX_MSGS) : \
422420
BUILD_SAFETY_CFG(ford_rx_checks, FORD_STOCK_TX_MSGS);
423421
}

0 commit comments

Comments
 (0)