mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
Plane: start logging when first needed
This commit is contained in:
parent
b5a16a07d3
commit
a15336079e
@ -164,6 +164,9 @@ DataFlash_Empty DataFlash;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// has a log download started?
|
||||||
|
static bool in_log_download;
|
||||||
|
|
||||||
// scaled roll limit based on pitch
|
// scaled roll limit based on pitch
|
||||||
static int32_t roll_limit_cd;
|
static int32_t roll_limit_cd;
|
||||||
static int32_t pitch_limit_min_cd;
|
static int32_t pitch_limit_min_cd;
|
||||||
|
@ -2182,7 +2182,17 @@ mission_failed:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MAVLINK_MSG_ID_LOG_REQUEST_LIST ... MAVLINK_MSG_ID_LOG_REQUEST_END:
|
case MAVLINK_MSG_ID_LOG_REQUEST_DATA:
|
||||||
|
case MAVLINK_MSG_ID_LOG_ERASE:
|
||||||
|
in_log_download = true;
|
||||||
|
// fallthru
|
||||||
|
case MAVLINK_MSG_ID_LOG_REQUEST_LIST:
|
||||||
|
if (!in_mavlink_delay) {
|
||||||
|
handle_log_message(msg, DataFlash);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case MAVLINK_MSG_ID_LOG_REQUEST_END:
|
||||||
|
in_log_download = false;
|
||||||
if (!in_mavlink_delay) {
|
if (!in_mavlink_delay) {
|
||||||
handle_log_message(msg, DataFlash);
|
handle_log_message(msg, DataFlash);
|
||||||
}
|
}
|
||||||
|
@ -142,9 +142,6 @@ static void init_ardupilot()
|
|||||||
gcs[i].reset_cli_timeout();
|
gcs[i].reset_cli_timeout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g.log_bitmask != 0) {
|
|
||||||
start_logging();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Register mavlink_delay_cb, which will run anytime you have
|
// Register mavlink_delay_cb, which will run anytime you have
|
||||||
@ -624,5 +621,9 @@ static bool should_log(uint32_t mask)
|
|||||||
} else {
|
} else {
|
||||||
armed = arming.is_armed();
|
armed = arming.is_armed();
|
||||||
}
|
}
|
||||||
return armed || (g.log_bitmask & MASK_LOG_WHEN_DISARMED) != 0;
|
bool ret = armed || (g.log_bitmask & MASK_LOG_WHEN_DISARMED) != 0;
|
||||||
|
if (ret && !DataFlash.logging_started() && !in_log_download) {
|
||||||
|
start_logging();
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user