mirror of https://github.com/ArduPilot/ardupilot
Copter: fix logging after log download
Downloading a log causes DataFlash to stop logging. Restart logging when we are not downloading and start_logging is called.
This commit is contained in:
parent
f0590581e4
commit
68630a86fe
|
@ -823,12 +823,16 @@ void Copter::Log_Write_Vehicle_Startup_Messages()
|
||||||
// start a new log
|
// start a new log
|
||||||
void Copter::start_logging()
|
void Copter::start_logging()
|
||||||
{
|
{
|
||||||
if (g.log_bitmask != 0) {
|
if (g.log_bitmask != 0 && !in_log_download) {
|
||||||
if (!ap.logging_started) {
|
if (!ap.logging_started) {
|
||||||
ap.logging_started = true;
|
ap.logging_started = true;
|
||||||
DataFlash.set_mission(&mission);
|
DataFlash.set_mission(&mission);
|
||||||
DataFlash.setVehicle_Startup_Log_Writer(FUNCTOR_BIND(&copter, &Copter::Log_Write_Vehicle_Startup_Messages, void));
|
DataFlash.setVehicle_Startup_Log_Writer(FUNCTOR_BIND(&copter, &Copter::Log_Write_Vehicle_Startup_Messages, void));
|
||||||
DataFlash.StartNewLog();
|
DataFlash.StartNewLog();
|
||||||
|
} else if (!DataFlash.logging_started()) {
|
||||||
|
// dataflash may have stopped logging - when we get_log_data,
|
||||||
|
// for example. Try to restart:
|
||||||
|
DataFlash.StartNewLog();
|
||||||
}
|
}
|
||||||
// enable writes
|
// enable writes
|
||||||
DataFlash.EnableWrites(true);
|
DataFlash.EnableWrites(true);
|
||||||
|
|
Loading…
Reference in New Issue