From aaeee2e7dccf8b611faf1737f74e190eb752f6f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 21 Sep 2023 08:58:03 +1000 Subject: [PATCH] AP_Compass: implement SIM_MAG_SAVE_IDS --- libraries/AP_Compass/AP_Compass_SITL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Compass/AP_Compass_SITL.cpp b/libraries/AP_Compass/AP_Compass_SITL.cpp index 2468721493..7bea9c9478 100644 --- a/libraries/AP_Compass/AP_Compass_SITL.cpp +++ b/libraries/AP_Compass/AP_Compass_SITL.cpp @@ -22,8 +22,10 @@ AP_Compass_SITL::AP_Compass_SITL() _compass_instance[_num_compass] = instance; set_dev_id(_compass_instance[_num_compass], dev_id); - // save so the compass always comes up configured in SITL - save_dev_id(_compass_instance[_num_compass]); + if (_sitl->mag_save_ids) { + // save so the compass always comes up configured in SITL + save_dev_id(_compass_instance[_num_compass]); + } set_rotation(instance, ROTATION_NONE); _num_compass++; }