From 747fc3814de7f131532cc1e48b945fe3c60518c5 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 1 Aug 2018 10:10:33 +1000 Subject: [PATCH] RC_Channel: rename in_rc_failsafe to has_valid_input --- libraries/RC_Channel/RC_Channel.h | 3 ++- libraries/RC_Channel/RC_Channels.cpp | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 262f39b173..95cd4bf142 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -303,7 +303,8 @@ public: void reset_mode_switch(); virtual void read_mode_switch(); - virtual bool in_rc_failsafe() const = 0; + // has_valid_input should be pure-virtual when Plane is converted + virtual bool has_valid_input() const { return false; }; private: static RC_Channels *_singleton; diff --git a/libraries/RC_Channel/RC_Channels.cpp b/libraries/RC_Channel/RC_Channels.cpp index 51d4f9d53e..e254592607 100644 --- a/libraries/RC_Channel/RC_Channels.cpp +++ b/libraries/RC_Channel/RC_Channels.cpp @@ -143,8 +143,8 @@ bool RC_Channels::receiver_bind(const int dsmMode) // read_aux_switches - checks aux switch positions and invokes configured actions void RC_Channels::read_aux_all() { - if (in_rc_failsafe()) { - // exit immediately during radio failsafe + if (!has_valid_input()) { + // exit immediately when no RC input return; } @@ -195,7 +195,8 @@ void RC_Channels::reset_mode_switch() void RC_Channels::read_mode_switch() { - if (in_rc_failsafe()) { + if (!has_valid_input()) { + // exit immediately when no RC input return; } RC_Channel *c = flight_mode_channel();