diff --git a/libraries/AP_HAL/AP_HAL.h b/libraries/AP_HAL/AP_HAL.h index ddd84d1efd..77585fff37 100644 --- a/libraries/AP_HAL/AP_HAL.h +++ b/libraries/AP_HAL/AP_HAL.h @@ -13,8 +13,8 @@ #include "Log.h" #include "Console.h" #include "GPIO.h" -#include "PPMInput.h" -#include "PWMOutput.h" +#include "RCInput.h" +#include "RCOutput.h" #include "Scheduler.h" #include "utility/Print.h" diff --git a/libraries/AP_HAL/AP_HAL_Namespace.h b/libraries/AP_HAL/AP_HAL_Namespace.h index 7ab117f72b..5615ed0928 100644 --- a/libraries/AP_HAL/AP_HAL_Namespace.h +++ b/libraries/AP_HAL/AP_HAL_Namespace.h @@ -16,8 +16,8 @@ namespace AP_HAL { class Log; class Console; class GPIO; - class PPMInput; - class PWMOutput; + class RCInput; + class RCOutput; class Scheduler; class EmptyUARTDriver; diff --git a/libraries/AP_HAL/HAL.h b/libraries/AP_HAL/HAL.h index 558da47dd3..1b70cd2eee 100644 --- a/libraries/AP_HAL/HAL.h +++ b/libraries/AP_HAL/HAL.h @@ -11,8 +11,8 @@ #include "../AP_HAL/Log.h" #include "../AP_HAL/Console.h" #include "../AP_HAL/GPIO.h" -#include "../AP_HAL/PPMInput.h" -#include "../AP_HAL/PWMOutput.h" +#include "../AP_HAL/RCInput.h" +#include "../AP_HAL/RCOutput.h" class AP_HAL::HAL { public: @@ -27,8 +27,8 @@ public: AP_HAL::Log* _log, AP_HAL::Console* _console, AP_HAL::GPIO* _gpio, - AP_HAL::PPMInput* _ppmin, - AP_HAL::PWMOutput* _pwmout, + AP_HAL::RCInput* _rcin, + AP_HAL::RCOutput* _rcout, AP_HAL::Scheduler* _scheduler) : uart0(_uart0), @@ -42,8 +42,8 @@ public: log(_log), console(_console), gpio(_gpio), - ppmin(_ppmin), - pwmout(_pwmout), + rcin(_rcin), + rcout(_rcout), scheduler(_scheduler) {} @@ -60,8 +60,8 @@ public: AP_HAL::Log* log; AP_HAL::Console* console; AP_HAL::GPIO* gpio; - AP_HAL::PPMInput* ppmin; - AP_HAL::PWMOutput* pwmout; + AP_HAL::RCInput* rcin; + AP_HAL::RCOutput* rcout; AP_HAL::Scheduler* scheduler; }; diff --git a/libraries/AP_HAL/PPMInput.h b/libraries/AP_HAL/PPMInput.h deleted file mode 100644 index 58bc01afaa..0000000000 --- a/libraries/AP_HAL/PPMInput.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef __AP_HAL_PPM_INPUT_H__ -#define __AP_HAL_PPM_INPUT_H__ - -#include "AP_HAL_Namespace.h" - -class AP_HAL::PPMInput { -public: - PPMInput() {} - virtual void init(int machtnicht) = 0; -}; - -#endif // __AP_HAL_PPM_INPUT_H__ - diff --git a/libraries/AP_HAL/PWMOutput.h b/libraries/AP_HAL/PWMOutput.h deleted file mode 100644 index c427e47994..0000000000 --- a/libraries/AP_HAL/PWMOutput.h +++ /dev/null @@ -1,14 +0,0 @@ - -#ifndef __AP_HAL_PWM_OUTPUT_H__ -#define __AP_HAL_PWM_OUTPUT_H__ - -#include "AP_HAL_Namespace.h" - -class AP_HAL::PWMOutput { -public: - PWMOutput() {} - virtual void init(int machtnicht) = 0; -}; - -#endif // __AP_HAL_PWM_OUTPUT_H__ - diff --git a/libraries/AP_HAL/RCInput.h b/libraries/AP_HAL/RCInput.h new file mode 100644 index 0000000000..4362a710ae --- /dev/null +++ b/libraries/AP_HAL/RCInput.h @@ -0,0 +1,14 @@ + +#ifndef __AP_HAL_RC_INPUT_H__ +#define __AP_HAL_RC_INPUT_H__ + +#include "AP_HAL_Namespace.h" + +class AP_HAL::RCInput { +public: + RCInput() {} + virtual void init(int machtnicht) = 0; +}; + +#endif // __AP_HAL_RC_INPUT_H__ + diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h new file mode 100644 index 0000000000..33e3c872b2 --- /dev/null +++ b/libraries/AP_HAL/RCOutput.h @@ -0,0 +1,14 @@ + +#ifndef __AP_HAL_RC_OUTPUT_H__ +#define __AP_HAL_RC_OUTPUT_H__ + +#include "AP_HAL_Namespace.h" + +class AP_HAL::RCOutput { +public: + RCOutput() {} + virtual void init(int machtnicht) = 0; +}; + +#endif // __AP_HAL_RC_OUTPUT_H__ + diff --git a/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp b/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp index bfc8388a23..6c89ccc62b 100644 --- a/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp +++ b/libraries/AP_HAL_AVR/AP_HAL_AVR.cpp @@ -12,8 +12,8 @@ #include "Log.h" #include "Console.h" #include "GPIO.h" -#include "PPMInput.h" -#include "PWMOutput.h" +#include "RCInput.h" +#include "RCOutput.h" #include "Scheduler.h" using namespace AP_HAL; @@ -36,10 +36,10 @@ static DataFlashAPM1Log apm1DataFlashLog; static DataFlashAPM2Log apm2DataFlashLog; static AVRUARTConsole avrUartConsole(&avrUart0Driver); static ArduinoGPIO arduinoGPIO; -static APM1PPMInput apm1PPMInput; -static APM2PPMInput apm2PPMInput; -static APM1PWMOutput apm1PWMOutput; -static APM2PWMOutput apm2PWMOutput; +static APM1RCInput apm1RCInput; +static APM2RCInput apm2RCInput; +static APM1RCOutput apm1RCOutput; +static APM2RCOutput apm2RCOutput; static ArduinoScheduler arduinoScheduler; const HAL_AVR AP_HAL_AVR_APM1( @@ -54,8 +54,8 @@ const HAL_AVR AP_HAL_AVR_APM1( &apm1DataFlashLog, &avrUartConsole, &arduinoGPIO, - &apm1PPMInput, - &apm1PWMOutput, + &apm1RCInput, + &apm1RCOutput, &arduinoScheduler ); const HAL_AVR AP_HAL_AVR_APM2( @@ -70,7 +70,7 @@ const HAL_AVR AP_HAL_AVR_APM2( &apm2DataFlashLog, &avrUartConsole, &arduinoGPIO, - &apm2PPMInput, - &apm2PWMOutput, + &apm2RCInput, + &apm2RCOutput, &arduinoScheduler ); diff --git a/libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h b/libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h index 03e1ef292f..98fa3bee9c 100644 --- a/libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h +++ b/libraries/AP_HAL_AVR/AP_HAL_AVR_Namespace.h @@ -14,10 +14,10 @@ namespace AP_HAL_AVR { class DataFlashAPM2Log; class AVRUARTConsole; class ArduinoGPIO; - class APM1PPMInput; - class APM2PPMInput; - class APM1PWMOutput; - class APM2PWMOutput; + class APM1RCInput; + class APM2RCInput; + class APM1RCOutput; + class APM2RCOutput; class ArduinoScheduler; } diff --git a/libraries/AP_HAL_AVR/HAL_AVR.h b/libraries/AP_HAL_AVR/HAL_AVR.h index b2617924a5..77e666f146 100644 --- a/libraries/AP_HAL_AVR/HAL_AVR.h +++ b/libraries/AP_HAL_AVR/HAL_AVR.h @@ -5,7 +5,8 @@ #include #include "AP_HAL_AVR_Namespace.h" -/* HAL_AVR class derives from HAL but provides an AVR-specific +/** + * HAL_AVR class derives from HAL but provides an AVR-specific * init method. */ @@ -23,13 +24,13 @@ public: AP_HAL::Log* _log, AP_HAL::Console* _console, AP_HAL::GPIO* _gpio, - AP_HAL::PPMInput* _ppmin, - AP_HAL::PWMOutput* _pwmout, + AP_HAL::RCInput* _rcin, + AP_HAL::RCOutput* _rcout, AP_HAL::Scheduler* _scheduler) : AP_HAL::HAL( _uart0, _uart1, _uart2, _uart3, _i2c, _spi, _analogIn, _storage, - _log, _console, _gpio, _ppmin, - _pwmout, _scheduler) {} + _log, _console, _gpio, _rcin, + _rcout, _scheduler) {} void init(void* opts) const; }; diff --git a/libraries/AP_HAL_AVR/PPMInput.h b/libraries/AP_HAL_AVR/PPMInput.h deleted file mode 100644 index 7ac60c7a76..0000000000 --- a/libraries/AP_HAL_AVR/PPMInput.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef __AP_HAL_AVR_PPM_INPUT_H__ -#define __AP_HAL_AVR_PPM_INPUT_H__ - -#include -#include "AP_HAL_AVR_Namespace.h" - -class AP_HAL_AVR::APM1PPMInput : public AP_HAL::PPMInput { -public: - APM1PPMInput() : _init(0) {} - void init(int machtnicht) { _init = 1; } -private: - int _init; -}; - -class AP_HAL_AVR::APM2PPMInput : public AP_HAL::PPMInput { -public: - APM2PPMInput() : _init(0) {} - void init(int machtnicht) { _init = 2; } -private: - int _init; -}; - -#endif // __AP_HAL_AVR_PPM_INPUT_H__ - diff --git a/libraries/AP_HAL_AVR/PWMOutput.h b/libraries/AP_HAL_AVR/PWMOutput.h deleted file mode 100644 index 9cfbc8655a..0000000000 --- a/libraries/AP_HAL_AVR/PWMOutput.h +++ /dev/null @@ -1,25 +0,0 @@ - -#ifndef __AP_HAL_AVR_PWM_OUTPUT_H__ -#define __AP_HAL_AVR_PWM_OUTPUT_H__ - -#include -#include "AP_HAL_AVR_Namespace.h" - -class AP_HAL_AVR::APM1PWMOutput : public AP_HAL::PWMOutput { -public: - APM1PWMOutput() : _init(0) {} - void init(int machtnicht) { _init = 1; } -private: - int _init; -}; - -class AP_HAL_AVR::APM2PWMOutput : public AP_HAL::PWMOutput { -public: - APM2PWMOutput() : _init(0) {} - void init(int machtnicht) { _init = 2; } -private: - int _init; -}; - -#endif // __AP_HAL_AVR_PWM_OUTPUT_H__ - diff --git a/libraries/AP_HAL_AVR/RCInput.h b/libraries/AP_HAL_AVR/RCInput.h new file mode 100644 index 0000000000..3be412dfa8 --- /dev/null +++ b/libraries/AP_HAL_AVR/RCInput.h @@ -0,0 +1,25 @@ + +#ifndef __AP_HAL_AVR_RC_INPUT_H__ +#define __AP_HAL_AVR_RC_INPUT_H__ + +#include +#include "AP_HAL_AVR_Namespace.h" + +class AP_HAL_AVR::APM1RCInput : public AP_HAL::RCInput { +public: + APM1RCInput() : _init(0) {} + void init(int machtnicht) { _init = 1; } +private: + int _init; +}; + +class AP_HAL_AVR::APM2RCInput : public AP_HAL::RCInput { +public: + APM2RCInput() : _init(0) {} + void init(int machtnicht) { _init = 2; } +private: + int _init; +}; + +#endif // __AP_HAL_AVR_RC_INPUT_H__ + diff --git a/libraries/AP_HAL_AVR/RCOutput.h b/libraries/AP_HAL_AVR/RCOutput.h new file mode 100644 index 0000000000..df4e3c14d4 --- /dev/null +++ b/libraries/AP_HAL_AVR/RCOutput.h @@ -0,0 +1,25 @@ + +#ifndef __AP_HAL_AVR_RC_OUTPUT_H__ +#define __AP_HAL_AVR_RC_OUTPUT_H__ + +#include +#include "AP_HAL_AVR_Namespace.h" + +class AP_HAL_AVR::APM1RCOutput : public AP_HAL::RCOutput { +public: + APM1RCOutput() : _init(0) {} + void init(int machtnicht) { _init = 1; } +private: + int _init; +}; + +class AP_HAL_AVR::APM2RCOutput : public AP_HAL::RCOutput { +public: + APM2RCOutput() : _init(0) {} + void init(int machtnicht) { _init = 2; } +private: + int _init; +}; + +#endif // __AP_HAL_AVR_RC_OUTPUT_H__ +