Rover: simplify dataflash initialisation

This commit is contained in:
Peter Barker 2017-06-12 23:03:57 +10:00 committed by Francisco Ferreira
parent 6f7954298c
commit 8c074c7b73

View File

@ -472,15 +472,9 @@ const LogStructure Rover::log_structure[] = {
void Rover::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");
for (uint8_t i=0; i < num_gcs; i++) {
gcs_chan[i].reset_cli_timeout();
}
for (uint8_t i=0; i < num_gcs; i++) {
gcs_chan[i].reset_cli_timeout();
}
if (g.log_bitmask != 0) {