mirror of https://github.com/ArduPilot/ardupilot
AP_Logger: minimal fix for allowing log listing while logging
this prevents loss of log data when listing logs on file backend
This commit is contained in:
parent
c8b8ff3380
commit
8fcb03350b
|
@ -620,6 +620,19 @@ bool AP_Logger::should_log(const uint32_t mask) const
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
return true if in log download which should prevent logging
|
||||
*/
|
||||
bool AP_Logger::in_log_download() const
|
||||
{
|
||||
if (uint8_t(_params.backend_types) & uint8_t(Backend_Type::BLOCK)) {
|
||||
// when we have a BLOCK backend then listing completely prevents logging
|
||||
return transfer_activity != TransferActivity::IDLE;
|
||||
}
|
||||
// for other backends listing does not interfere with logging
|
||||
return transfer_activity == TransferActivity::SENDING;
|
||||
}
|
||||
|
||||
const struct UnitStructure *AP_Logger::unit(uint16_t num) const
|
||||
{
|
||||
return &_units[num];
|
||||
|
|
|
@ -404,9 +404,7 @@ public:
|
|||
bool vehicle_is_armed() const { return _armed; }
|
||||
|
||||
void handle_log_send();
|
||||
bool in_log_download() const {
|
||||
return transfer_activity != TransferActivity::IDLE;
|
||||
}
|
||||
bool in_log_download() const;
|
||||
|
||||
float quiet_nanf() const { return nanf("0x4152"); } // "AR"
|
||||
double quiet_nan() const { return nan("0x4152445550490a"); } // "ARDUPI"
|
||||
|
|
|
@ -429,7 +429,8 @@ bool AP_Logger_Backend::ShouldLog(bool is_critical)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_front._last_mavlink_log_transfer_message_handled_ms != 0) {
|
||||
if (_front.in_log_download() &&
|
||||
_front._last_mavlink_log_transfer_message_handled_ms != 0) {
|
||||
if (AP_HAL::millis() - _front._last_mavlink_log_transfer_message_handled_ms < 10000) {
|
||||
if (!_front.vehicle_is_armed()) {
|
||||
// user is transfering files via mavlink
|
||||
|
|
Loading…
Reference in New Issue