RC_Channel: rename in_rc_failsafe to has_valid_input

This commit is contained in:
Peter Barker 2018-08-01 10:10:33 +10:00 committed by Randy Mackay
parent 61c34ea98c
commit 747fc3814d
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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();