diff --git a/libraries/AP_HAL_Linux/RCInput.cpp b/libraries/AP_HAL_Linux/RCInput.cpp index 8775bad751..0dc4586fd6 100644 --- a/libraries/AP_HAL_Linux/RCInput.cpp +++ b/libraries/AP_HAL_Linux/RCInput.cpp @@ -5,42 +5,71 @@ #include "RCInput.h" using namespace Linux; -LinuxRCInput::LinuxRCInput() +LinuxRCInput::LinuxRCInput() : +new_rc_input(false) {} void LinuxRCInput::init(void* machtnichts) {} -bool LinuxRCInput::new_input() { +bool LinuxRCInput::new_input() +{ + return new_rc_input; +} + +uint8_t LinuxRCInput::num_channels() +{ + return 8; +} + +uint16_t LinuxRCInput::read(uint8_t ch) +{ + new_rc_input = false; + if (_override[ch]) { + return _override[ch]; + } + if (ch == 2) { + // force low throttle for now + return 900; + } + return 1500; +} + +uint8_t LinuxRCInput::read(uint16_t* periods, uint8_t len) +{ + for (uint8_t i=0; i