HAL_Empty: removed Console driver

This commit is contained in:
Andrew Tridgell 2013-10-05 18:32:35 +10:00
parent 930d664677
commit 8e7d9bb464
5 changed files with 1 additions and 81 deletions

View File

@ -15,7 +15,6 @@ namespace Empty {
class EmptyAnalogSource;
class EmptyAnalogIn;
class EmptyStorage;
class EmptyConsoleDriver;
class EmptyGPIO;
class EmptyDigitalSource;
class EmptyRCInput;

View File

@ -11,7 +11,6 @@
#include "SPIDriver.h"
#include "AnalogIn.h"
#include "Storage.h"
#include "Console.h"
#include "GPIO.h"
#include "RCInput.h"
#include "RCOutput.h"

View File

@ -1,51 +0,0 @@
#include <stdarg.h>
#include "Console.h"
using namespace Empty;
EmptyConsoleDriver::EmptyConsoleDriver(AP_HAL::BetterStream* delegate) :
_d(delegate)
{}
void EmptyConsoleDriver::init(void* machtnichts)
{}
void EmptyConsoleDriver::backend_open()
{}
void EmptyConsoleDriver::backend_close()
{}
size_t EmptyConsoleDriver::backend_read(uint8_t *data, size_t len) {
return 0;
}
size_t EmptyConsoleDriver::backend_write(const uint8_t *data, size_t len) {
return 0;
}
int16_t EmptyConsoleDriver::available() {
return _d->available();
}
int16_t EmptyConsoleDriver::txspace() {
return _d->txspace();
}
int16_t EmptyConsoleDriver::read() {
return _d->read();
}
size_t EmptyConsoleDriver::write(uint8_t c) {
return _d->write(c);
}
size_t EmptyConsoleDriver::write(const uint8_t *buffer, size_t size)
{
size_t n = 0;
while (size--) {
n += write(*buffer++);
}
return n;
}

View File

@ -1,26 +0,0 @@
#ifndef __AP_HAL_EMPTY_CONSOLE_H__
#define __AP_HAL_EMPTY_CONSOLE_H__
#include <AP_HAL_Empty.h>
class Empty::EmptyConsoleDriver : public AP_HAL::ConsoleDriver {
public:
EmptyConsoleDriver(AP_HAL::BetterStream* delegate);
void init(void* machtnichts);
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);
int16_t available();
int16_t txspace();
int16_t read();
size_t write(uint8_t c);
size_t write(const uint8_t *buffer, size_t size);
private:
AP_HAL::BetterStream *_d;
};
#endif // __AP_HAL_EMPTY_CONSOLE_H__

View File

@ -15,7 +15,6 @@ static EmptyI2CDriver i2cDriver(&i2cSemaphore);
static EmptySPIDeviceManager spiDeviceManager;
static EmptyAnalogIn analogIn;
static EmptyStorage storageDriver;
static EmptyConsoleDriver consoleDriver(&uartADriver);
static EmptyGPIO gpioDriver;
static EmptyRCInput rcinDriver;
static EmptyRCOutput rcoutDriver;
@ -31,7 +30,7 @@ HAL_Empty::HAL_Empty() :
&spiDeviceManager,
&analogIn,
&storageDriver,
&consoleDriver,
&uartADriver,
&gpioDriver,
&rcinDriver,
&rcoutDriver,