Browse Source

HAL_AVR: removed Console driver

mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
7072c52b57
  1. 1
      libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h
  2. 1
      libraries/AP_HAL_AVR/AP_HAL_AVR_private.h
  3. 56
      libraries/AP_HAL_AVR/Console.cpp
  4. 32
      libraries/AP_HAL_AVR/Console.h
  5. 4
      libraries/AP_HAL_AVR/HAL_AVR_APM1_Class.cpp
  6. 4
      libraries/AP_HAL_AVR/HAL_AVR_APM2_Class.cpp

1
libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h

@ -15,7 +15,6 @@ namespace AP_HAL_AVR { @@ -15,7 +15,6 @@ namespace AP_HAL_AVR {
class ADCSource;
class AVRAnalogIn;
class AVREEPROMStorage;
class AVRConsoleDriver;
class AVRGPIO;
class AVRDigitalSource;
class APM1RCInput;

1
libraries/AP_HAL_AVR/AP_HAL_AVR_private.h

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

56
libraries/AP_HAL_AVR/Console.cpp

@ -1,56 +0,0 @@ @@ -1,56 +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_APM1 || CONFIG_HAL_BOARD == HAL_BOARD_APM2
#include <limits.h>
#include "Console.h"
using namespace AP_HAL_AVR;
// ConsoleDriver method implementations ///////////////////////////////////////
void AVRConsoleDriver::init(void* base_uart) {
_base_uart = (AP_HAL::UARTDriver*) base_uart;
}
void AVRConsoleDriver::backend_open() {
}
void AVRConsoleDriver::backend_close() {
}
size_t AVRConsoleDriver::backend_read(uint8_t *data, size_t len) {
return 0;
}
size_t AVRConsoleDriver::backend_write(const uint8_t *data, size_t len) {
return 0;
}
// Stream method implementations /////////////////////////////////////////
int16_t AVRConsoleDriver::available(void) {
return _base_uart->available();
}
int16_t AVRConsoleDriver::txspace(void) {
return _base_uart->txspace();
}
int16_t AVRConsoleDriver::read() {
return _base_uart->read();
}
// Print method implementations /////////////////////////////////////////
size_t AVRConsoleDriver::write(uint8_t c) {
return _base_uart->write(c);
}
size_t AVRConsoleDriver::write(const uint8_t *buffer, size_t size) {
return _base_uart->write(buffer, size);
}
#endif // CONFIG_HAL_BOARD

32
libraries/AP_HAL_AVR/Console.h

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
#ifndef __AP_HAL_AVR_CONSOLE_DRIVER_H__
#define __AP_HAL_AVR_CONSOLE_DRIVER_H__
#include <stdlib.h>
#include <AP_HAL.h>
#include "AP_HAL_AVR_Namespace.h"
class AP_HAL_AVR::AVRConsoleDriver : public AP_HAL::ConsoleDriver {
public:
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__

4
libraries/AP_HAL_AVR/HAL_AVR_APM1_Class.cpp

@ -26,7 +26,6 @@ static AVRI2CDriver avrI2CDriver(&i2cSemaphore); @@ -26,7 +26,6 @@ static AVRI2CDriver avrI2CDriver(&i2cSemaphore);
static APM1SPIDeviceManager apm1SPIDriver;
static AVRAnalogIn avrAnalogIn;
static AVREEPROMStorage avrEEPROMStorage;
static AVRConsoleDriver consoleDriver;
static AVRGPIO avrGPIO;
static APM1RCInput apm1RCInput;
static APM1RCOutput apm1RCOutput;
@ -45,7 +44,7 @@ HAL_AVR_APM1::HAL_AVR_APM1() : @@ -45,7 +44,7 @@ HAL_AVR_APM1::HAL_AVR_APM1() :
&apm1SPIDriver,
&avrAnalogIn,
&avrEEPROMStorage,
&consoleDriver,
&avrUart0Driver,
&avrGPIO,
&apm1RCInput,
&apm1RCOutput,
@ -60,7 +59,6 @@ void HAL_AVR_APM1::init(int argc, char * const argv[]) const { @@ -60,7 +59,6 @@ void HAL_AVR_APM1::init(int argc, char * const argv[]) const {
/* uartA is the serial port used for the console, so lets make sure
* it is initialized at boot */
uartA->begin(115200);
console->init((void*)uartA);
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
* as the init argument */
rcin->init((void*)&isrRegistry);

4
libraries/AP_HAL_AVR/HAL_AVR_APM2_Class.cpp

@ -26,7 +26,6 @@ static AVRI2CDriver avrI2CDriver(&i2cSemaphore); @@ -26,7 +26,6 @@ static AVRI2CDriver avrI2CDriver(&i2cSemaphore);
static APM2SPIDeviceManager apm2SPIDriver;
static AVRAnalogIn avrAnalogIn;
static AVREEPROMStorage avrEEPROMStorage;
static AVRConsoleDriver consoleDriver;
static AVRGPIO avrGPIO;
static APM2RCInput apm2RCInput;
static APM2RCOutput apm2RCOutput;
@ -44,7 +43,7 @@ HAL_AVR_APM2::HAL_AVR_APM2() : @@ -44,7 +43,7 @@ HAL_AVR_APM2::HAL_AVR_APM2() :
&apm2SPIDriver,
&avrAnalogIn,
&avrEEPROMStorage,
&consoleDriver,
&avrUart0Driver,
&avrGPIO,
&apm2RCInput,
&apm2RCOutput,
@ -59,7 +58,6 @@ void HAL_AVR_APM2::init(int argc, char * const argv[]) const { @@ -59,7 +58,6 @@ void HAL_AVR_APM2::init(int argc, char * const argv[]) const {
/* uartA is the serial port used for the console, so lets make sure
* it is initialized at boot */
uartA->begin(115200, 128, 128);
console->init((void*)uartA);
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
* as the init argument */
rcin->init((void*)&isrRegistry);

Loading…
Cancel
Save