AP_HAL_ChibiOS: instantiate SIMState object in HAL

This commit is contained in:
Peter Barker 2021-11-01 18:16:41 +11:00 committed by Peter Barker
parent 26d6c2413b
commit 8b2f85756a

View File

@ -34,6 +34,7 @@
#include <AP_Logger/AP_Logger.h> #include <AP_Logger/AP_Logger.h>
#endif #endif
#include <AP_Vehicle/AP_Vehicle_Type.h> #include <AP_Vehicle/AP_Vehicle_Type.h>
#include <AP_HAL/SIMState.h>
#include <hwdef.h> #include <hwdef.h>
@ -97,6 +98,10 @@ static ChibiOS::Scheduler schedulerInstance;
static ChibiOS::Util utilInstance; static ChibiOS::Util utilInstance;
static Empty::OpticalFlow opticalFlowDriver; static Empty::OpticalFlow opticalFlowDriver;
#if AP_SIM_ENABLED
static AP_HAL::SIMState xsimstate;
#endif
#if HAL_WITH_DSP #if HAL_WITH_DSP
static ChibiOS::DSP dspDriver; static ChibiOS::DSP dspDriver;
#else #else
@ -152,6 +157,9 @@ HAL_ChibiOS::HAL_ChibiOS() :
&utilInstance, &utilInstance,
&opticalFlowDriver, &opticalFlowDriver,
&flashDriver, &flashDriver,
#if AP_SIM_ENABLED
&xsimstate,
#endif
&dspDriver, &dspDriver,
#if HAL_NUM_CAN_IFACES #if HAL_NUM_CAN_IFACES
(AP_HAL::CANIface**)canDrivers (AP_HAL::CANIface**)canDrivers