Copter: simplify should_log (NFC)
This commit is contained in:
parent
32d02b1f18
commit
43a16b9327
@ -491,14 +491,22 @@ void Copter::check_usb_mux(void)
|
||||
bool Copter::should_log(uint32_t mask)
|
||||
{
|
||||
#if LOGGING_ENABLED == ENABLED
|
||||
if (!(mask & g.log_bitmask) || in_mavlink_delay) {
|
||||
if (in_mavlink_delay) {
|
||||
return false;
|
||||
}
|
||||
bool ret = motors->armed() || DataFlash.log_while_disarmed();
|
||||
if (ret && !DataFlash.logging_started() && !in_log_download) {
|
||||
if (!(mask & g.log_bitmask)) {
|
||||
return false;
|
||||
}
|
||||
if (!motors->armed() && !DataFlash.log_while_disarmed()) {
|
||||
return false;
|
||||
}
|
||||
if (in_log_download) {
|
||||
return false;
|
||||
}
|
||||
if (!DataFlash.logging_started()) {
|
||||
start_logging();
|
||||
}
|
||||
return ret;
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user