diff --git a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp index 997a349b18..f5bc43bdde 100644 --- a/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp +++ b/libraries/AP_AHRS/AP_AHRS_NavEKF.cpp @@ -21,6 +21,7 @@ #include #include "AP_AHRS.h" #include "AP_AHRS_View.h" +#include #include #include #include @@ -50,6 +51,10 @@ AP_AHRS_NavEKF::AP_AHRS_NavEKF(uint8_t flags) : // init sets up INS board orientation void AP_AHRS_NavEKF::init() { + // EKF1 is no longer supported - handle case where it is selected + if (_ekf_type.get() == 1) { + AP_BoardConfig::config_error("EKF1 not available"); + } #if !HAL_NAVEKF2_AVAILABLE && HAL_NAVEKF3_AVAILABLE if (_ekf_type.get() == 2) { _ekf_type.set(3); @@ -117,11 +122,6 @@ void AP_AHRS_NavEKF::update(bool skip_ins_update) // drop back to normal priority if we were boosted by the INS // calling delay_microseconds_boost() hal.scheduler->boost_end(); - - // EKF1 is no longer supported - handle case where it is selected - if (_ekf_type == 1) { - _ekf_type.set(2); - } update_DCM(skip_ins_update);