Copter: move init of DataFlash references into vehicle init
It is possible to start a log before the existing codepath is crossed.
This commit is contained in:
parent
ee16205438
commit
069e0d1973
@ -912,8 +912,6 @@ void Copter::start_logging()
|
||||
if (g.log_bitmask != 0 && !in_log_download) {
|
||||
if (!ap.logging_started) {
|
||||
ap.logging_started = true;
|
||||
DataFlash.set_mission(&mission);
|
||||
DataFlash.setVehicle_Startup_Log_Writer(FUNCTOR_BIND(&copter, &Copter::Log_Write_Vehicle_Startup_Messages, void));
|
||||
DataFlash.StartNewLog();
|
||||
} else if (!DataFlash.logging_started()) {
|
||||
// dataflash may have stopped logging - when we get_log_data,
|
||||
|
@ -288,6 +288,10 @@ void Copter::init_ardupilot()
|
||||
// initialise mission library
|
||||
mission.init();
|
||||
|
||||
// initialise DataFlash library
|
||||
DataFlash.set_mission(&mission);
|
||||
DataFlash.setVehicle_Startup_Log_Writer(FUNCTOR_BIND(&copter, &Copter::Log_Write_Vehicle_Startup_Messages, void));
|
||||
|
||||
// initialise the flight mode and aux switch
|
||||
// ---------------------------
|
||||
reset_control_switch();
|
||||
|
Loading…
Reference in New Issue
Block a user