Andrew Tridgell
12 years ago
4 changed files with 1 additions and 105 deletions
@ -1,66 +0,0 @@
@@ -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 @@
@@ -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__
|
||||
|
Loading…
Reference in new issue