Plane: ensure 10% free space when initialising logging

This commit is contained in:
Peter Barker 2015-08-08 16:13:47 +10:00 committed by Andrew Tridgell
parent 60010e794e
commit 3c0355e9e2

View File

@ -539,13 +539,15 @@ void Plane::log_init(void)
if (!DataFlash.CardInserted()) { if (!DataFlash.CardInserted()) {
gcs_send_text_P(MAV_SEVERITY_WARNING, PSTR("No dataflash card inserted")); gcs_send_text_P(MAV_SEVERITY_WARNING, PSTR("No dataflash card inserted"));
g.log_bitmask.set(0); g.log_bitmask.set(0);
} else if (DataFlash.NeedErase()) { } else if (DataFlash.NeedPrep()) {
gcs_send_text_P(MAV_SEVERITY_WARNING, PSTR("ERASING LOGS")); gcs_send_text_P(MAV_SEVERITY_WARNING, PSTR("Preparing log system"));
do_erase_logs(); DataFlash.Prep();
gcs_send_text_P(MAV_SEVERITY_WARNING, PSTR("Prepared log system"));
for (uint8_t i=0; i<num_gcs; i++) { for (uint8_t i=0; i<num_gcs; i++) {
gcs[i].reset_cli_timeout(); gcs[i].reset_cli_timeout();
} }
} }
arming.set_logging_available(DataFlash.CardInserted()); arming.set_logging_available(DataFlash.CardInserted());
} }