Plane: stop using in_mavlink_delay as a proxy for disabling logging

This commit is contained in:
Peter Barker 2017-06-15 11:59:53 +10:00 committed by Francisco Ferreira
parent 4163455d97
commit 30dfd32b87
3 changed files with 4 additions and 5 deletions

View File

@ -2132,6 +2132,7 @@ void Plane::mavlink_delay_cb()
if (!gcs().chan(0).initialised || in_mavlink_delay) return;
in_mavlink_delay = true;
DataFlash.EnableWrites(false);
uint32_t tnow = millis();
if (tnow - last_1hz > 1000) {
@ -2150,6 +2151,7 @@ void Plane::mavlink_delay_cb()
gcs_send_text(MAV_SEVERITY_INFO, "Initialising APM");
}
DataFlash.EnableWrites(true);
in_mavlink_delay = false;
}

View File

@ -85,9 +85,9 @@ int8_t Plane::dump_log(uint8_t argc, const Menu::arg *argv)
int8_t Plane::erase_logs(uint8_t argc, const Menu::arg *argv)
{
in_mavlink_delay = true;
DataFlash.EnableWrites(false);
do_erase_logs();
in_mavlink_delay = false;
DataFlash.EnableWrites(true);
return 0;
}

View File

@ -835,9 +835,6 @@ void Plane::print_comma(void)
bool Plane::should_log(uint32_t mask)
{
#if LOGGING_ENABLED == ENABLED
if (in_mavlink_delay) {
return false;
}
if (!(mask & g.log_bitmask)) {
return false;
}