AP_Logger: force logging on an armed watchdog reset

and don't clear sdcard space
This commit is contained in:
Andrew Tridgell 2019-04-20 11:26:05 +10:00
parent 9ca67dc811
commit 24c5bf42ae
2 changed files with 8 additions and 0 deletions

View File

@ -92,6 +92,10 @@ AP_Logger::AP_Logger(const AP_Int32 &log_bitmask)
void AP_Logger::Init(const struct LogStructure *structures, uint8_t num_types)
{
gcs().send_text(MAV_SEVERITY_INFO, "Preparing log system");
if (hal.util->was_watchdog_armed()) {
gcs().send_text(MAV_SEVERITY_INFO, "Forcing logging for watchdog reset");
_params.log_disarmed.set(1);
}
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
validate_structures(structures, num_types);
dump_structures(structures, num_types);

View File

@ -303,6 +303,10 @@ uint16_t AP_Logger_File::find_oldest_log()
void AP_Logger_File::Prep_MinSpace()
{
if (hal.util->was_watchdog_reset()) {
// don't clear space if watchdog reset, it takes too long
return;
}
const uint16_t first_log_to_remove = find_oldest_log();
if (first_log_to_remove == 0) {
// no files to remove