mirror of https://github.com/ArduPilot/ardupilot
RC_Channel: rename in_rc_failsafe to has_valid_input
This commit is contained in:
parent
61c34ea98c
commit
747fc3814d
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue