mirror of https://github.com/ArduPilot/ardupilot
AVR_SITL: removed Console driver
This commit is contained in:
parent
7072c52b57
commit
930d664677
|
@ -6,7 +6,6 @@ namespace AVR_SITL {
|
|||
class SITLUARTDriver;
|
||||
class SITLScheduler;
|
||||
class SITL_State;
|
||||
class SITLConsoleDriver;
|
||||
class SITLEEPROMStorage;
|
||||
class SITLAnalogIn;
|
||||
class SITLRCInput;
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
#include <AP_HAL.h>
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include "Console.h"
|
||||
|
||||
using namespace AVR_SITL;
|
||||
|
||||
SITLConsoleDriver::SITLConsoleDriver() {}
|
||||
|
||||
// ConsoleDriver method implementations ///////////////////////////////////////
|
||||
void SITLConsoleDriver::init(void* base_uart)
|
||||
{
|
||||
_base_uart = (AP_HAL::UARTDriver*) base_uart;
|
||||
}
|
||||
|
||||
|
||||
void SITLConsoleDriver::backend_open()
|
||||
{
|
||||
}
|
||||
|
||||
void SITLConsoleDriver::backend_close()
|
||||
{
|
||||
}
|
||||
|
||||
size_t SITLConsoleDriver::backend_read(uint8_t *data, size_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t SITLConsoleDriver::backend_write(const uint8_t *data, size_t len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Stream method implementations /////////////////////////////////////////
|
||||
int16_t SITLConsoleDriver::available(void)
|
||||
{
|
||||
return _base_uart->available();
|
||||
}
|
||||
|
||||
int16_t SITLConsoleDriver::txspace(void)
|
||||
{
|
||||
return _base_uart->txspace();
|
||||
}
|
||||
|
||||
int16_t SITLConsoleDriver::read()
|
||||
{
|
||||
return _base_uart->read();
|
||||
}
|
||||
|
||||
// Print method implementations /////////////////////////////////////////
|
||||
|
||||
size_t SITLConsoleDriver::write(uint8_t c)
|
||||
{
|
||||
return _base_uart->write(c);
|
||||
}
|
||||
|
||||
size_t SITLConsoleDriver::write(const uint8_t *buffer, size_t size) {
|
||||
return _base_uart->write(buffer, size);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,34 +0,0 @@
|
|||
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
#ifndef __AP_HAL_AVR_SITL_CONSOLE_DRIVER_H__
|
||||
#define __AP_HAL_AVR_SITL_CONSOLE_DRIVER_H__
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <AP_HAL.h>
|
||||
#include "AP_HAL_AVR_SITL_Namespace.h"
|
||||
|
||||
class AVR_SITL::SITLConsoleDriver : public AP_HAL::ConsoleDriver {
|
||||
public:
|
||||
SITLConsoleDriver();
|
||||
void init(void* baseuartdriver);
|
||||
void backend_open();
|
||||
void backend_close();
|
||||
size_t backend_read(uint8_t *data, size_t len);
|
||||
size_t backend_write(const uint8_t *data, size_t len);
|
||||
|
||||
/* Implementations of Stream virtual methods */
|
||||
int16_t available();
|
||||
int16_t txspace();
|
||||
int16_t read();
|
||||
|
||||
/* Implementations of Print virtual methods */
|
||||
size_t write(uint8_t c);
|
||||
size_t write(const uint8_t *buffer, size_t size);
|
||||
|
||||
private:
|
||||
AP_HAL::UARTDriver* _base_uart;
|
||||
};
|
||||
|
||||
#endif // __AP_HAL_AVR_CONSOLE_DRIVER_H__
|
||||
|
|
@ -13,7 +13,6 @@
|
|||
#include "AnalogIn.h"
|
||||
#include "UARTDriver.h"
|
||||
#include "Storage.h"
|
||||
#include "Console.h"
|
||||
#include "RCInput.h"
|
||||
#include "RCOutput.h"
|
||||
#include "SITL_State.h"
|
||||
|
@ -26,7 +25,6 @@ using namespace AVR_SITL;
|
|||
|
||||
static SITLScheduler sitlScheduler;
|
||||
static SITLEEPROMStorage sitlEEPROMStorage;
|
||||
static SITLConsoleDriver consoleDriver;
|
||||
static SITL_State sitlState;
|
||||
static SITLRCInput sitlRCInput(&sitlState);
|
||||
static SITLRCOutput sitlRCOutput(&sitlState);
|
||||
|
@ -53,7 +51,7 @@ HAL_AVR_SITL::HAL_AVR_SITL() :
|
|||
&emptySPI, /* spi */
|
||||
&sitlAnalogIn, /* analogin */
|
||||
&sitlEEPROMStorage, /* storage */
|
||||
&consoleDriver, /* console */
|
||||
&sitlUart0Driver, /* console */
|
||||
&emptyGPIO, /* gpio */
|
||||
&sitlRCInput, /* rcinput */
|
||||
&sitlRCOutput, /* rcoutput */
|
||||
|
@ -67,7 +65,6 @@ void HAL_AVR_SITL::init(int argc, char * const argv[]) const
|
|||
_sitl_state->init(argc, argv);
|
||||
scheduler->init(NULL);
|
||||
uartA->begin(115200);
|
||||
console->init((void*) uartA);
|
||||
|
||||
rcin->init(NULL);
|
||||
rcout->init(NULL);
|
||||
|
|
Loading…
Reference in New Issue