AP_HAL: guard against DSP being compiled out of code

This commit is contained in:
Peter Barker 2023-09-14 21:21:37 +10:00 committed by Peter Barker
parent f83b561566
commit 9e5edefc4a
1 changed files with 6 additions and 2 deletions

View File

@ -46,7 +46,9 @@ public:
#if AP_SIM_ENABLED && CONFIG_HAL_BOARD != HAL_BOARD_SITL #if AP_SIM_ENABLED && CONFIG_HAL_BOARD != HAL_BOARD_SITL
class AP_HAL::SIMState* _simstate, class AP_HAL::SIMState* _simstate,
#endif #endif
#if HAL_WITH_DSP
AP_HAL::DSP* _dsp, AP_HAL::DSP* _dsp,
#endif
#if HAL_NUM_CAN_IFACES > 0 #if HAL_NUM_CAN_IFACES > 0
AP_HAL::CANIface* _can_ifaces[HAL_NUM_CAN_IFACES]) AP_HAL::CANIface* _can_ifaces[HAL_NUM_CAN_IFACES])
#else #else
@ -76,11 +78,13 @@ public:
scheduler(_scheduler), scheduler(_scheduler),
util(_util), util(_util),
opticalflow(_opticalflow), opticalflow(_opticalflow),
flash(_flash), #if HAL_WITH_DSP
dsp(_dsp),
#endif
#if AP_SIM_ENABLED && CONFIG_HAL_BOARD != HAL_BOARD_SITL #if AP_SIM_ENABLED && CONFIG_HAL_BOARD != HAL_BOARD_SITL
simstate(_simstate), simstate(_simstate),
#endif #endif
dsp(_dsp) flash(_flash)
{ {
#if HAL_NUM_CAN_IFACES > 0 #if HAL_NUM_CAN_IFACES > 0
if (_can_ifaces == nullptr) { if (_can_ifaces == nullptr) {