Browse Source

AP_HAL: Don't need a separate Console class, BetterStream will do.

master
Pat Hickey 13 years ago committed by Andrew Tridgell
parent
commit
5d2327f52f
  1. 1
      libraries/AP_HAL/AP_HAL.h
  2. 1
      libraries/AP_HAL/AP_HAL_Namespace.h
  3. 14
      libraries/AP_HAL/Console.h
  4. 5
      libraries/AP_HAL/HAL.h
  5. 6
      libraries/AP_HAL_AVR/AP_HAL_AVR.cpp
  6. 1
      libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h
  7. 20
      libraries/AP_HAL_AVR/Console.h
  8. 6
      libraries/AP_HAL_AVR/HAL_AVR.cpp
  9. 2
      libraries/AP_HAL_AVR/HAL_AVR.h

1
libraries/AP_HAL/AP_HAL.h

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

1
libraries/AP_HAL/AP_HAL_Namespace.h

@ -14,7 +14,6 @@ namespace AP_HAL { @@ -14,7 +14,6 @@ namespace AP_HAL {
class AnalogIn;
class Storage;
class Log;
class Console;
class GPIO;
class RCInput;
class RCOutput;

14
libraries/AP_HAL/Console.h

@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
#ifndef __AP_HAL_CONSOLE_H__
#define __AP_HAL_CONSOLE_H__
#include "AP_HAL_Namespace.h"
class AP_HAL::Console {
public:
Console() {}
virtual void init(int machtnicht) = 0;
};
#endif // __AP_HAL_CONSOLE_H__

5
libraries/AP_HAL/HAL.h

@ -9,7 +9,6 @@ @@ -9,7 +9,6 @@
#include "../AP_HAL/AnalogIn.h"
#include "../AP_HAL/Storage.h"
#include "../AP_HAL/Log.h"
#include "../AP_HAL/Console.h"
#include "../AP_HAL/GPIO.h"
#include "../AP_HAL/RCInput.h"
#include "../AP_HAL/RCOutput.h"
@ -25,7 +24,7 @@ public: @@ -25,7 +24,7 @@ public:
AP_HAL::AnalogIn* _analogIn,
AP_HAL::Storage* _storage,
AP_HAL::Log* _log,
AP_HAL::Console* _console,
AP_HAL::BetterStream* _console,
AP_HAL::GPIO* _gpio,
AP_HAL::RCInput* _rcin,
AP_HAL::RCOutput* _rcout,
@ -58,7 +57,7 @@ public: @@ -58,7 +57,7 @@ public:
AP_HAL::AnalogIn* analogIn;
AP_HAL::Storage* storage;
AP_HAL::Log* log;
AP_HAL::Console* console;
AP_HAL::BetterStream* console;
AP_HAL::GPIO* gpio;
AP_HAL::RCInput* rcin;
AP_HAL::RCOutput* rcout;

6
libraries/AP_HAL_AVR/AP_HAL_AVR.cpp

@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
#include "AnalogIn.h"
#include "Storage.h"
#include "Log.h"
#include "Console.h"
#include "GPIO.h"
#include "RCInput.h"
#include "RCOutput.h"
@ -34,7 +33,6 @@ static ArduinoAnalogIn arduinoAnalogIn; @@ -34,7 +33,6 @@ static ArduinoAnalogIn arduinoAnalogIn;
static AVREEPROMStorage avrEEPROMStorage;
static DataFlashAPM1Log apm1DataFlashLog;
static DataFlashAPM2Log apm2DataFlashLog;
static AVRUARTConsole avrUartConsole(&avrUart0Driver);
static ArduinoGPIO arduinoGPIO;
static APM1RCInput apm1RCInput;
static APM2RCInput apm2RCInput;
@ -52,7 +50,7 @@ const HAL_AVR AP_HAL_AVR_APM1( @@ -52,7 +50,7 @@ const HAL_AVR AP_HAL_AVR_APM1(
&arduinoAnalogIn,
&avrEEPROMStorage,
&apm1DataFlashLog,
&avrUartConsole,
(BetterStream*) &avrUart0Driver,
&arduinoGPIO,
&apm1RCInput,
&apm1RCOutput,
@ -68,7 +66,7 @@ const HAL_AVR AP_HAL_AVR_APM2( @@ -68,7 +66,7 @@ const HAL_AVR AP_HAL_AVR_APM2(
&arduinoAnalogIn,
&avrEEPROMStorage,
&apm2DataFlashLog,
&avrUartConsole,
(BetterStream *) &avrUart0Driver,
&arduinoGPIO,
&apm2RCInput,
&apm2RCOutput,

1
libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h

@ -12,7 +12,6 @@ namespace AP_HAL_AVR { @@ -12,7 +12,6 @@ namespace AP_HAL_AVR {
class AVREEPROMStorage;
class DataFlashAPM1Log;
class DataFlashAPM2Log;
class AVRUARTConsole;
class ArduinoGPIO;
class APM1RCInput;
class APM2RCInput;

20
libraries/AP_HAL_AVR/Console.h

@ -1,20 +0,0 @@ @@ -1,20 +0,0 @@
#ifndef __AP_HAL_AVR_CONSOLE_H__
#define __AP_HAL_AVR_CONSOLE_H__
#include <AP_HAL.h>
#include "AP_HAL_AVR_Namespace.h"
#include "UARTDriver.h"
class AP_HAL_AVR::AVRUARTConsole : public AP_HAL::Console {
public:
AVRUARTConsole( AVRUARTDriver* driver ) : _driver(driver), _init(0) {}
void init(int machtnicht) { _init = 1; }
private:
const AVRUARTDriver* _driver;
int _init;
};
#endif // __AP_HAL_AVR_CONSOLE_H__

6
libraries/AP_HAL_AVR/HAL_AVR.cpp

@ -5,7 +5,11 @@ using namespace AP_HAL_AVR; @@ -5,7 +5,11 @@ using namespace AP_HAL_AVR;
void HAL_AVR::init(void* opts) const {
scheduler->init();
/* uart0 is the serial port used for the console, so lets make sure
* it is initialized at boot */
// XXX maybe this should be 57600?
uart0->begin(115200);
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
* as the init argument */
rcin->init((void*)&isr_registry);

2
libraries/AP_HAL_AVR/HAL_AVR.h

@ -23,7 +23,7 @@ public: @@ -23,7 +23,7 @@ public:
AP_HAL::AnalogIn* _analogIn,
AP_HAL::Storage* _storage,
AP_HAL::Log* _log,
AP_HAL::Console* _console,
AP_HAL::BetterStream* _console,
AP_HAL::GPIO* _gpio,
AP_HAL::RCInput* _rcin,
AP_HAL::RCOutput* _rcout,

Loading…
Cancel
Save