diff --git a/AntennaTracker/AntennaTracker.cpp b/AntennaTracker/AntennaTracker.cpp index f4339b4bc7..73f456919d 100644 --- a/AntennaTracker/AntennaTracker.cpp +++ b/AntennaTracker/AntennaTracker.cpp @@ -37,6 +37,7 @@ const AP_Scheduler::Task Tracker::scheduler_tasks[] = { SCHED_TASK(update_tracking, 50, 1000), SCHED_TASK(update_GPS, 10, 4000), SCHED_TASK(update_compass, 10, 1500), + SCHED_TASK(compass_save, 0.02, 200), SCHED_TASK_CLASS(AP_BattMonitor, &tracker.battery, read, 10, 1500), SCHED_TASK_CLASS(AP_Baro, &tracker.barometer, update, 10, 1500), SCHED_TASK_CLASS(GCS, (GCS*)&tracker._gcs, update_receive, 50, 1700), @@ -95,13 +96,6 @@ void Tracker::one_second_loop() // updated armed/disarmed status LEDs update_armed_disarmed(); - one_second_counter++; - - if (one_second_counter >= 60) { - compass_save(); - one_second_counter = 0; - } - // init compass location for declination init_compass_location(); diff --git a/AntennaTracker/Tracker.h b/AntennaTracker/Tracker.h index 1e4a0bb3f1..ca170c448b 100644 --- a/AntennaTracker/Tracker.h +++ b/AntennaTracker/Tracker.h @@ -195,7 +195,6 @@ private: // setup the var_info table AP_Param param_loader{var_info}; - uint8_t one_second_counter = 0; bool target_set = false; bool stationary = true; // are we using the start lat and log?