Copter: ensure 10% free space when initialising logging

This commit is contained in:
Peter Barker 2015-08-08 16:14:02 +10:00 committed by Andrew Tridgell
parent d6e380496c
commit 1103451d36

View File

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