diff --git a/libraries/AP_Tuning/AP_Tuning.cpp b/libraries/AP_Tuning/AP_Tuning.cpp index c78f53c849..a84e0c9c5c 100644 --- a/libraries/AP_Tuning/AP_Tuning.cpp +++ b/libraries/AP_Tuning/AP_Tuning.cpp @@ -1,5 +1,6 @@ #include "AP_Tuning.h" #include +#include extern const AP_HAL::HAL& hal; @@ -141,7 +142,7 @@ void AP_Tuning::check_input(uint8_t flightmode) } last_check_ms = now; - if (channel > hal.rcin->num_channels()) { + if (channel > RC_Channels::get_valid_channel_count()) { // not valid channel return; }