diff --git a/libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h b/libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h index a551c42e41..6057edc445 100644 --- a/libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h +++ b/libraries/AP_HAL_AVR_SITL/AP_HAL_AVR_SITL_Namespace.h @@ -6,7 +6,6 @@ namespace AVR_SITL { class SITLUARTDriver; class SITLScheduler; class SITL_State; - class SITLConsoleDriver; class SITLEEPROMStorage; class SITLAnalogIn; class SITLRCInput; diff --git a/libraries/AP_HAL_AVR_SITL/Console.cpp b/libraries/AP_HAL_AVR_SITL/Console.cpp deleted file mode 100644 index 8a079c350d..0000000000 --- a/libraries/AP_HAL_AVR_SITL/Console.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- - -#include -#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL - -#include -#include -#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 diff --git a/libraries/AP_HAL_AVR_SITL/Console.h b/libraries/AP_HAL_AVR_SITL/Console.h deleted file mode 100644 index 93625abd6f..0000000000 --- a/libraries/AP_HAL_AVR_SITL/Console.h +++ /dev/null @@ -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 - -#include -#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__ - diff --git a/libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp b/libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp index a3d00a6832..df0249797a 100644 --- a/libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp +++ b/libraries/AP_HAL_AVR_SITL/HAL_AVR_SITL_Class.cpp @@ -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);