diff --git a/libraries/RC_Channel/RC_Channel.h b/libraries/RC_Channel/RC_Channel.h index 377bb957af..c80f42335d 100644 --- a/libraries/RC_Channel/RC_Channel.h +++ b/libraries/RC_Channel/RC_Channel.h @@ -513,7 +513,7 @@ public: // check if flight mode channel is assigned RC option // return true if assigned - bool flight_mode_channel_conflicts_with_rc_option(); + bool flight_mode_channel_conflicts_with_rc_option() const; // flight_mode_channel_number must be overridden in vehicle specific code virtual int8_t flight_mode_channel_number() const = 0; @@ -549,7 +549,7 @@ private: AP_Int32 _options; AP_Int32 _protocols; - RC_Channel *flight_mode_channel(); + RC_Channel *flight_mode_channel() const; // Allow override by default at start bool _gcs_overrides_enabled = true; diff --git a/libraries/RC_Channel/RC_Channels.cpp b/libraries/RC_Channel/RC_Channels.cpp index 2ac94a390f..4284451833 100644 --- a/libraries/RC_Channel/RC_Channels.cpp +++ b/libraries/RC_Channel/RC_Channels.cpp @@ -183,7 +183,7 @@ void RC_Channels::init_aux_all() // // Support for mode switches // -RC_Channel *RC_Channels::flight_mode_channel() +RC_Channel *RC_Channels::flight_mode_channel() const { const int8_t num = flight_mode_channel_number(); if (num <= 0) { @@ -192,7 +192,7 @@ RC_Channel *RC_Channels::flight_mode_channel() if (num >= NUM_RC_CHANNELS) { return nullptr; } - return channel(num-1); + return rc_channel(num-1); } void RC_Channels::reset_mode_switch() @@ -219,7 +219,7 @@ void RC_Channels::read_mode_switch() // check if flight mode channel is assigned RC option // return true if assigned -bool RC_Channels::flight_mode_channel_conflicts_with_rc_option() +bool RC_Channels::flight_mode_channel_conflicts_with_rc_option() const { RC_Channel *chan = flight_mode_channel(); if (chan == nullptr) {