mirror of https://github.com/ArduPilot/ardupilot
AP_Logger: force logging on an armed watchdog reset
and don't clear sdcard space
This commit is contained in:
parent
f217f504e5
commit
a378f2b8fa
|
@ -84,6 +84,10 @@ DataFlash_Class::DataFlash_Class(const AP_Int32 &log_bitmask)
|
||||||
void DataFlash_Class::Init(const struct LogStructure *structures, uint8_t num_types)
|
void DataFlash_Class::Init(const struct LogStructure *structures, uint8_t num_types)
|
||||||
{
|
{
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "Preparing log system");
|
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
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||||
validate_structures(structures, num_types);
|
validate_structures(structures, num_types);
|
||||||
dump_structures(structures, num_types);
|
dump_structures(structures, num_types);
|
||||||
|
|
|
@ -342,6 +342,10 @@ uint16_t DataFlash_File::find_oldest_log()
|
||||||
|
|
||||||
void DataFlash_File::Prep_MinSpace()
|
void DataFlash_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();
|
const uint16_t first_log_to_remove = find_oldest_log();
|
||||||
if (first_log_to_remove == 0) {
|
if (first_log_to_remove == 0) {
|
||||||
// no files to remove
|
// no files to remove
|
||||||
|
|
Loading…
Reference in New Issue