Plane: simplify dataflash initialisation

This commit is contained in:
Peter Barker 2017-06-12 23:04:31 +10:00 committed by Francisco Ferreira
parent 019dd02569
commit c6beb3a867
1 changed files with 2 additions and 8 deletions

View File

@ -570,14 +570,8 @@ void Plane::start_logging()
void Plane::log_init(void)
{
DataFlash.Init(log_structure, ARRAY_SIZE(log_structure));
if (!DataFlash.CardInserted()) {
gcs_send_text(MAV_SEVERITY_WARNING, "No dataflash card inserted");
} else if (DataFlash.NeedPrep()) {
gcs_send_text(MAV_SEVERITY_INFO, "Preparing log system");
DataFlash.Prep();
gcs_send_text(MAV_SEVERITY_INFO, "Prepared log system");
gcs().reset_cli_timeout();
}
gcs().reset_cli_timeout();
}
#else // LOGGING_ENABLED