AP_HAL_SITL: guard against DSP being compiled out of code

This commit is contained in:
Peter Barker 2023-09-14 21:05:58 +10:00 committed by Peter Barker
parent 3bd8f1a3df
commit f83b561566
3 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,8 @@
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#if HAL_WITH_DSP
#include "AP_HAL_SITL.h" #include "AP_HAL_SITL.h"
#include <AP_Math/AP_Math.h> #include <AP_Math/AP_Math.h>
#include <GCS_MAVLink/GCS.h> #include <GCS_MAVLink/GCS.h>
@ -209,3 +211,5 @@ void DSP::calculate_fft(complexf *samples, uint16_t fftlen)
istep <<= 1; istep <<= 1;
} }
} }
#endif

View File

@ -17,6 +17,9 @@
#pragma once #pragma once
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#if HAL_WITH_DSP
#include "AP_HAL_SITL.h" #include "AP_HAL_SITL.h"
#include <complex> #include <complex>
@ -55,3 +58,5 @@ private:
void vector_add_float(const float* vin1, const float* vin2, float* vout, uint16_t len) const override; void vector_add_float(const float* vin1, const float* vin2, float* vout, uint16_t len) const override;
void calculate_fft(complexf* f, uint16_t length); void calculate_fft(complexf* f, uint16_t length);
}; };
#endif

View File

@ -46,7 +46,9 @@ static Empty::RCInput sitlRCInput;
static RCOutput sitlRCOutput(&sitlState); static RCOutput sitlRCOutput(&sitlState);
static GPIO sitlGPIO(&sitlState); static GPIO sitlGPIO(&sitlState);
static AnalogIn sitlAnalogIn(&sitlState); static AnalogIn sitlAnalogIn(&sitlState);
#if HAL_WITH_DSP
static DSP dspDriver; static DSP dspDriver;
#endif
// use the Empty HAL for hardware we don't emulate // use the Empty HAL for hardware we don't emulate
@ -104,7 +106,9 @@ HAL_SITL::HAL_SITL() :
&utilInstance, /* util */ &utilInstance, /* util */
&emptyOpticalFlow, /* onboard optical flow */ &emptyOpticalFlow, /* onboard optical flow */
&emptyFlash, /* flash driver */ &emptyFlash, /* flash driver */
#if HAL_WITH_DSP
&dspDriver, /* dsp driver */ &dspDriver, /* dsp driver */
#endif
#if HAL_NUM_CAN_IFACES #if HAL_NUM_CAN_IFACES
(AP_HAL::CANIface**)canDrivers (AP_HAL::CANIface**)canDrivers
#else #else