mirror of https://github.com/ArduPilot/ardupilot
SITL: make ToshibaLED simulator optional
This commit is contained in:
parent
d0872abdf9
commit
1abef3275e
|
@ -49,7 +49,9 @@ public:
|
|||
};
|
||||
static IgnoredI2CDevice ignored;
|
||||
|
||||
#if AP_SIM_TOSHIBALED_ENABLED
|
||||
static ToshibaLED toshibaled;
|
||||
#endif
|
||||
static MaxSonarI2CXL maxsonari2cxl;
|
||||
static MaxSonarI2CXL maxsonari2cxl_2;
|
||||
static Maxell maxell;
|
||||
|
@ -70,7 +72,9 @@ struct i2c_device_at_address {
|
|||
{ 0, 0x60, mcp9600 }, // 0x60 is low address
|
||||
{ 0, 0x71, maxsonari2cxl_2 },
|
||||
{ 1, 0x01, icm40609 },
|
||||
#if AP_SIM_TOSHIBALED_ENABLED
|
||||
{ 1, 0x55, toshibaled },
|
||||
#endif
|
||||
{ 1, 0x38, ignored }, // NCP5623
|
||||
{ 1, 0x39, ignored }, // NCP5623C
|
||||
{ 1, 0x40, ignored }, // KellerLD
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "SIM_ToshibaLED.h"
|
||||
|
||||
#if AP_SIM_TOSHIBALED_ENABLED
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void SITL::ToshibaLED::update(const class Aircraft &aircraft)
|
||||
|
@ -17,3 +19,5 @@ void SITL::ToshibaLED::update(const class Aircraft &aircraft)
|
|||
last_print_enable = get_register(ToshibaLEDDevReg::ENABLE);
|
||||
// gcs().send_text(MAV_SEVERITY_INFO, "SIM_ToshibaLED: PWM0=%u PWM1=%u PWM2=%u ENABLE=%u", last_print_pwm0, last_print_pwm1, last_print_pwm2, last_print_enable);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
#include "SIM_I2CDevice.h"
|
||||
|
||||
#include <AP_HAL/AP_HAL_Boards.h>
|
||||
|
||||
#ifndef AP_SIM_TOSHIBALED_ENABLED
|
||||
#define AP_SIM_TOSHIBALED_ENABLED (CONFIG_HAL_BOARD == HAL_BOARD_SITL)
|
||||
#endif
|
||||
|
||||
#if AP_SIM_TOSHIBALED_ENABLED
|
||||
|
||||
namespace SITL {
|
||||
|
||||
class ToshibaLEDDevReg : public I2CRegEnum {
|
||||
|
@ -34,3 +42,5 @@ private:
|
|||
};
|
||||
|
||||
} // namespace SITL
|
||||
|
||||
#endif // AP_SIM_TOSHIBALED_ENABLED
|
||||
|
|
Loading…
Reference in New Issue