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:
Peter Barker 2016-07-28 12:22:39 +10:00 committed by Randy Mackay
parent f0590581e4
commit 68630a86fe
1 changed files with 5 additions and 1 deletions

View File

@ -823,12 +823,16 @@ void Copter::Log_Write_Vehicle_Startup_Messages()
// start a new log
void Copter::start_logging()
{
if (g.log_bitmask != 0) {
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,
// for example. Try to restart:
DataFlash.StartNewLog();
}
// enable writes
DataFlash.EnableWrites(true);