diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index 5f18df1fbf..c8b32d2a3a 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -379,6 +379,8 @@ void Compass::init() } #endif // COMPASS_MAX_INSTANCES + convert_per_instance(); + // cache expected dev ids for use during runtime detection for (StateIndex i(0); isnprintf(param_name, sizeof(param_name), "COMPASS%i_%s", i+1, elem.name); + AP_Param::convert_old_parameter(&info, 1.0f, 0); + } + } +} + #if COMPASS_MAX_INSTANCES > 1 || COMPASS_MAX_UNREG_DEV // Update Priority List for Mags, by default, we just // load them as they come up the first time diff --git a/libraries/AP_Compass/AP_Compass.h b/libraries/AP_Compass/AP_Compass.h index 651a523241..351b5bce93 100644 --- a/libraries/AP_Compass/AP_Compass.h +++ b/libraries/AP_Compass/AP_Compass.h @@ -598,6 +598,9 @@ private: bool init_done; uint8_t _first_usable; // first compass usable based on COMPASSx_USE param + + // convet params to per instance param table + void convert_per_instance(); }; namespace AP {