mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
Plane: simplify should_log (NFC)
This commit is contained in:
parent
332e5059e2
commit
927cc75843
@ -835,14 +835,22 @@ void Plane::print_comma(void)
|
|||||||
bool Plane::should_log(uint32_t mask)
|
bool Plane::should_log(uint32_t mask)
|
||||||
{
|
{
|
||||||
#if LOGGING_ENABLED == ENABLED
|
#if LOGGING_ENABLED == ENABLED
|
||||||
if (!(mask & g.log_bitmask) || in_mavlink_delay) {
|
if (in_mavlink_delay) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bool ret = hal.util->get_soft_armed() || DataFlash.log_while_disarmed();
|
if (!(mask & g.log_bitmask)) {
|
||||||
if (ret && !DataFlash.logging_started() && !in_log_download) {
|
return false;
|
||||||
|
}
|
||||||
|
if (!hal.util->get_soft_armed() && !DataFlash.log_while_disarmed()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (in_log_download) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!DataFlash.logging_started()) {
|
||||||
start_logging();
|
start_logging();
|
||||||
}
|
}
|
||||||
return ret;
|
return true;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user