SITL: correct compilation for SimOnHardware

This commit is contained in:
Peter Barker 2023-05-22 13:04:36 +10:00 committed by Peter Barker
parent 6b40fd11d6
commit 34a55166f8
5 changed files with 29 additions and 15 deletions

View File

@ -45,14 +45,12 @@ rc 2 1450
#pragma once #pragma once
#include "SIM_SerialProximitySensor.h" #include "SIM_config.h"
#ifndef HAL_SIM_PS_RPLIDARA2_ENABLED
#define HAL_SIM_PS_RPLIDARA2_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#endif
#if HAL_SIM_PS_RPLIDARA2_ENABLED || HAL_SIM_PS_RPLIDARA1_ENABLED #if HAL_SIM_PS_RPLIDARA2_ENABLED || HAL_SIM_PS_RPLIDARA1_ENABLED
#include "SIM_SerialProximitySensor.h"
#include <stdio.h> #include <stdio.h>
namespace SITL { namespace SITL {

View File

@ -43,13 +43,12 @@ rc 2 1450
#pragma once #pragma once
#include "SIM_PS_RPLidar.h" #include "SIM_config.h"
#ifndef HAL_SIM_PS_RPLIDARA1_ENABLED
#define HAL_SIM_PS_RPLIDARA1_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#endif
#if HAL_SIM_PS_RPLIDARA1_ENABLED #if HAL_SIM_PS_RPLIDARA1_ENABLED
#include "SIM_PS_RPLidar.h"
namespace SITL { namespace SITL {
class PS_RPLidarA1 : public PS_RPLidar { class PS_RPLidarA1 : public PS_RPLidar {

View File

@ -43,6 +43,10 @@ rc 2 1450
#pragma once #pragma once
#include "SIM_config.h"
#if HAL_SIM_PS_RPLIDARA2_ENABLED
#include "SIM_PS_RPLidar.h" #include "SIM_PS_RPLidar.h"
namespace SITL { namespace SITL {
@ -54,3 +58,5 @@ public:
}; };
} }
#endif // HAL_SIM_PS_RPLIDARA2_ENABLED

View File

@ -18,11 +18,7 @@
#pragma once #pragma once
#include <AP_HAL/AP_HAL_Boards.h> #include "SIM_config.h"
#ifndef HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#define HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL)
#endif
#if HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED #if HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED

View File

@ -0,0 +1,15 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#define HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL)
#endif
#ifndef HAL_SIM_PS_RPLIDARA1_ENABLED
#define HAL_SIM_PS_RPLIDARA1_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#endif
#ifndef HAL_SIM_PS_RPLIDARA2_ENABLED
#define HAL_SIM_PS_RPLIDARA2_ENABLED HAL_SIM_SERIALPROXIMITYSENSOR_ENABLED
#endif