Copter: Let modes stop Attitude Logging

This commit is contained in:
Leonard Hall 2019-07-29 17:05:12 +09:30 committed by Randy Mackay
parent 63d9b47530
commit 91be844b66
2 changed files with 6 additions and 2 deletions

View File

@ -330,7 +330,7 @@ void Copter::update_batt_compass(void)
// should be run at 400hz
void Copter::fourhundred_hz_logging()
{
if (should_log(MASK_LOG_ATTITUDE_FAST)) {
if (should_log(MASK_LOG_ATTITUDE_FAST) && !copter.flightmode->stop_attitude_logging()) {
Log_Write_Attitude();
}
}
@ -340,8 +340,11 @@ void Copter::fourhundred_hz_logging()
void Copter::ten_hz_logging_loop()
{
// log attitude data if we're not already logging at the higher rate
if (should_log(MASK_LOG_ATTITUDE_MED) && !should_log(MASK_LOG_ATTITUDE_FAST)) {
if (should_log(MASK_LOG_ATTITUDE_MED) && !should_log(MASK_LOG_ATTITUDE_FAST) && !copter.flightmode->stop_attitude_logging()) {
Log_Write_Attitude();
}
// log EKF attitude data
if (should_log(MASK_LOG_ATTITUDE_MED) || should_log(MASK_LOG_ATTITUDE_FAST)) {
Log_Write_EKF_POS();
}
if (should_log(MASK_LOG_MOTBATT)) {

View File

@ -55,6 +55,7 @@ public:
virtual bool is_autopilot() const { return false; }
virtual bool has_user_takeoff(bool must_navigate) const { return false; }
virtual bool in_guided_mode() const { return false; }
virtual bool stop_attitude_logging() const { return false; }
// return a string for this flightmode
virtual const char *name() const = 0;