Browse Source

SITL: switched to empty driver for unimplemented backends

mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
334b96b375
  1. 1
      libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h
  2. 31
      libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp

1
libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h

@ -10,6 +10,7 @@ namespace AVR_SITL {
class SITLEEPROMStorage; class SITLEEPROMStorage;
class SITLAnalogIn; class SITLAnalogIn;
class ADCSource; class ADCSource;
class RCInput;
} }
#endif // __AP_HAL_AVR_SITL_NAMESPACE_H__ #endif // __AP_HAL_AVR_SITL_NAMESPACE_H__

31
libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp

@ -14,19 +14,27 @@
#include "UARTDriver.h" #include "UARTDriver.h"
#include "Storage.h" #include "Storage.h"
#include "Console.h" #include "Console.h"
#include "RCInput.h"
#include "SITL_State.h" #include "SITL_State.h"
#include <AP_HAL_Empty.h>
#include <AP_HAL_Empty_Private.h>
using namespace AVR_SITL; using namespace AVR_SITL;
static SITLScheduler sitlScheduler; static SITLScheduler sitlScheduler;
static SITLEEPROMStorage sitlEEPROMStorage; static SITLEEPROMStorage sitlEEPROMStorage;
static SITLConsoleDriver consoleDriver; static SITLConsoleDriver consoleDriver;
static SITLAnalogIn sitlAnalogIn;
static SITL_State sitlState; static SITL_State sitlState;
static SITLUARTDriver sitlUart0Driver(0); static Empty::EmptyRCInput emptyRCInput;
static SITLUARTDriver sitlUart1Driver(1); static Empty::EmptyRCOutput emptyRCOutput;
static SITLUARTDriver sitlUart2Driver(2); static Empty::EmptyGPIO emptyGPIO;
static Empty::EmptyAnalogIn emptyAnalogIn;
static SITLUARTDriver sitlUart0Driver(0, &sitlState);
static SITLUARTDriver sitlUart1Driver(1, &sitlState);
static SITLUARTDriver sitlUart2Driver(2, &sitlState);
HAL_AVR_SITL::HAL_AVR_SITL() : HAL_AVR_SITL::HAL_AVR_SITL() :
AP_HAL::HAL( AP_HAL::HAL(
@ -35,12 +43,14 @@ HAL_AVR_SITL::HAL_AVR_SITL() :
&sitlUart2Driver, /* uartC */ &sitlUart2Driver, /* uartC */
NULL, /* i2c */ NULL, /* i2c */
NULL, /* spi */ NULL, /* spi */
&sitlAnalogIn, /* analogin */ &emptyAnalogIn, /* analogin */
&sitlEEPROMStorage, /* storage */ &sitlEEPROMStorage, /* storage */
&consoleDriver, /* console */ &consoleDriver, /* console */
NULL, /* gpio */
NULL, /* rcinput */ &emptyGPIO, /* gpio */
NULL, /* rcoutput */ &emptyRCInput, /* rcinput */
&emptyRCOutput, /* rcoutput */
&sitlScheduler), /* scheduler */ &sitlScheduler), /* scheduler */
_sitl_state(&sitlState) _sitl_state(&sitlState)
{} {}
@ -52,8 +62,9 @@ void HAL_AVR_SITL::init(int argc, char * const argv[]) const
uartA->begin(115200); uartA->begin(115200);
console->init((void*) uartA); console->init((void*) uartA);
//rcin->init(NULL); rcin->init(NULL);
//rcout->init(NULL); rcout->init(NULL);
//spi->init(NULL); //spi->init(NULL);
//i2c->begin(); //i2c->begin();
//i2c->setTimeout(100); //i2c->setTimeout(100);

Loading…
Cancel
Save