Sub: move setup method up to AP_Vehicle base class

This commit is contained in:
Peter Barker 2020-01-16 21:31:00 +11:00 committed by Andrew Tridgell
parent a45abc7762
commit 87b84ec196
2 changed files with 12 additions and 12 deletions

View File

@ -80,19 +80,17 @@ const AP_Scheduler::Task Sub::scheduler_tasks[] = {
#endif #endif
}; };
constexpr int8_t Sub::_failsafe_priorities[5]; void Sub::get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
uint8_t &task_count,
void Sub::setup() uint32_t &log_bit)
{ {
// Load the default values of variables listed in var_info[]s tasks = &scheduler_tasks[0];
AP_Param::setup_sketch_defaults(); task_count = ARRAY_SIZE(scheduler_tasks);
log_bit = MASK_LOG_PM;
init_ardupilot();
// initialise the main loop scheduler
scheduler.init(&scheduler_tasks[0], ARRAY_SIZE(scheduler_tasks), MASK_LOG_PM);
} }
constexpr int8_t Sub::_failsafe_priorities[5];
void Sub::loop() void Sub::loop()
{ {
scheduler.loop(); scheduler.loop();

View File

@ -132,7 +132,6 @@ public:
Sub(void); Sub(void);
// HAL::Callbacks implementation. // HAL::Callbacks implementation.
void setup() override;
void loop() override; void loop() override;
private: private:
@ -573,7 +572,10 @@ private:
#endif #endif
void terrain_update(); void terrain_update();
void terrain_logging(); void terrain_logging();
void init_ardupilot(); void init_ardupilot() override;
void get_scheduler_tasks(const AP_Scheduler::Task *&tasks,
uint8_t &task_count,
uint32_t &log_bit) override;
void startup_INS_ground(); void startup_INS_ground();
bool position_ok(); bool position_ok();
bool ekf_position_ok(); bool ekf_position_ok();