Tracker: move setup method up to AP_Vehicle base class

This commit is contained in:
Peter Barker 2020-01-16 21:25:40 +11:00 committed by Andrew Tridgell
parent 0728514f74
commit dfc274e547
3 changed files with 12 additions and 15 deletions

View File

@ -55,18 +55,13 @@ const AP_Scheduler::Task Tracker::scheduler_tasks[] = {
SCHED_TASK(accel_cal_update, 10, 100) SCHED_TASK(accel_cal_update, 10, 100)
}; };
/** void Tracker::get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
setup the sketch - called once on startup uint8_t &task_count,
*/ uint32_t &log_bit)
void Tracker::setup()
{ {
// load the default values of variables listed in var_info[] tasks = &scheduler_tasks[0];
AP_Param::setup_sketch_defaults(); task_count = ARRAY_SIZE(scheduler_tasks);
log_bit = (uint32_t)-1;
init_tracker();
// initialise the main loop scheduler
scheduler.init(&scheduler_tasks[0], ARRAY_SIZE(scheduler_tasks), (uint32_t)-1);
} }
/** /**

View File

@ -77,7 +77,6 @@ public:
static const AP_FWVersion fwver; static const AP_FWVersion fwver;
// HAL::Callbacks implementation. // HAL::Callbacks implementation.
void setup() override;
void loop() override; void loop() override;
private: private:
@ -174,7 +173,10 @@ private:
// true if the compass's initial location has been set // true if the compass's initial location has been set
bool compass_init_location; bool compass_init_location;
// AntennaTracker.cpp // Tracker.cpp
void get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
uint8_t &task_count,
uint32_t &log_bit) override;
void one_second_loop(); void one_second_loop();
void ten_hz_logging_loop(); void ten_hz_logging_loop();
void stats_update(); void stats_update();
@ -215,7 +217,7 @@ private:
void update_yaw_cr_servo(float yaw); void update_yaw_cr_servo(float yaw);
// system.cpp // system.cpp
void init_tracker(); void init_ardupilot() override;
bool get_home_eeprom(struct Location &loc); bool get_home_eeprom(struct Location &loc);
bool set_home_eeprom(const Location &temp) WARN_IF_UNUSED; bool set_home_eeprom(const Location &temp) WARN_IF_UNUSED;
bool set_home(const Location &temp) WARN_IF_UNUSED; bool set_home(const Location &temp) WARN_IF_UNUSED;

View File

@ -3,7 +3,7 @@
// mission storage // mission storage
static const StorageAccess wp_storage(StorageManager::StorageMission); static const StorageAccess wp_storage(StorageManager::StorageMission);
void Tracker::init_tracker() void Tracker::init_ardupilot()
{ {
// initialise console serial port // initialise console serial port
serial_manager.init_console(); serial_manager.init_console();