@@ -398,26 +398,24 @@ static safety_config ford_init(uint16_t param) {
398
398
{FORD_LateralMotionControl , 0 , 8 },
399
399
};
400
400
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
+
402
406
#ifdef ALLOW_DEBUG
403
407
const uint16_t FORD_PARAM_LONGITUDINAL = 1 ;
404
- const uint16_t FORD_PARAM_CANFD = 2 ;
405
408
ford_longitudinal = GET_FLAG (param , FORD_PARAM_LONGITUDINAL );
406
- ford_canfd = GET_FLAG (param , FORD_PARAM_CANFD );
407
409
#endif
408
410
409
411
// Longitudinal is the default for CAN, and optional for CAN FD w/ ALLOW_DEBUG
410
412
ford_longitudinal = !ford_canfd || ford_longitudinal ;
411
413
412
414
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
416
415
if (ford_canfd ) {
417
416
ret = ford_longitudinal ? BUILD_SAFETY_CFG (ford_rx_checks , FORD_CANFD_LONG_TX_MSGS ) : \
418
417
BUILD_SAFETY_CFG (ford_rx_checks , FORD_CANFD_STOCK_TX_MSGS );
419
418
} else {
420
- // cppcheck-suppress knownConditionTrueFalse
421
419
ret = ford_longitudinal ? BUILD_SAFETY_CFG (ford_rx_checks , FORD_LONG_TX_MSGS ) : \
422
420
BUILD_SAFETY_CFG (ford_rx_checks , FORD_STOCK_TX_MSGS );
423
421
}
0 commit comments