From 517e20093e2739a86e86867593db9f2cf460d5c8 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Wed, 25 Apr 2018 15:42:47 -0700 Subject: [PATCH] AP_HAL_Linux: Remove set_overrides() method --- libraries/AP_HAL_Linux/RCInput.cpp | 12 ------------ libraries/AP_HAL_Linux/RCInput.h | 1 - libraries/AP_HAL_Linux/RCOutput_qflight.cpp | 10 +++++++++- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/libraries/AP_HAL_Linux/RCInput.cpp b/libraries/AP_HAL_Linux/RCInput.cpp index 8459d179d1..e812e4e3c7 100644 --- a/libraries/AP_HAL_Linux/RCInput.cpp +++ b/libraries/AP_HAL_Linux/RCInput.cpp @@ -68,18 +68,6 @@ uint8_t RCInput::read(uint16_t* periods, uint8_t len) return len; } -bool RCInput::set_overrides(int16_t *overrides, uint8_t len) -{ - bool res = false; - if(len > LINUX_RC_INPUT_NUM_CHANNELS){ - len = LINUX_RC_INPUT_NUM_CHANNELS; - } - for (uint8_t i = 0; i < len; i++) { - res |= set_override(i, overrides[i]); - } - return res; -} - bool RCInput::set_override(uint8_t channel, int16_t override) { if (override < 0) return false; /* -1: no change. */ diff --git a/libraries/AP_HAL_Linux/RCInput.h b/libraries/AP_HAL_Linux/RCInput.h index 6eec1b3474..3ad74ca3ff 100644 --- a/libraries/AP_HAL_Linux/RCInput.h +++ b/libraries/AP_HAL_Linux/RCInput.h @@ -26,7 +26,6 @@ public: return _rssi; } - bool set_overrides(int16_t *overrides, uint8_t len); bool set_override(uint8_t channel, int16_t override); void clear_overrides(); diff --git a/libraries/AP_HAL_Linux/RCOutput_qflight.cpp b/libraries/AP_HAL_Linux/RCOutput_qflight.cpp index c80113f47d..9168184875 100644 --- a/libraries/AP_HAL_Linux/RCOutput_qflight.cpp +++ b/libraries/AP_HAL_Linux/RCOutput_qflight.cpp @@ -19,6 +19,8 @@ */ #include +#include + #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_QFLIGHT #include "RCOutput_qflight.h" @@ -166,7 +168,13 @@ void RCOutput_QFLIGHT::check_rc_in(void) } } if (have_data) { - hal.rcin->set_overrides((int16_t*)rcu.rcin.rcin, 8); + // FIXME: This is an incredibly dirty hack as this probhibits the usage of + // overrides if an RC reciever is connected, as the next RC input will + // stomp over the GCS set overrides. This results in incredibly confusing, + // undocumented behaviour, that cannot be reported to the user. + for (uint8_t i = 0; i < 8; i++) { + RC_Channels::set_override(i, rcu.rcin.rcin[i]); + } } } nrcin_bytes = 0;