AP_NavEKF3: allow compilation with HAL_LOGGING_ENABLED false

This commit is contained in:
Peter Barker 2023-07-14 10:58:07 +10:00 committed by Andrew Tridgell
parent 3a76ce3162
commit 0afed2f8c2
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
#include <AP_Logger/AP_Logger_config.h>
#if HAL_LOGGING_ENABLED
#include "AP_NavEKF3.h"
#include "AP_NavEKF3_core.h"
@ -440,3 +444,5 @@ void NavEKF3_core::Log_Write_GSF(uint64_t time_us)
}
yawEstimator->Log_Write(time_us, LOG_XKY0_MSG, LOG_XKY1_MSG, DAL_CORE(core_index));
}
#endif // HAL_LOGGING_ENABLED

View File

@ -1394,6 +1394,7 @@ void NavEKF3_core::updateMovementCheck(void)
if (logStatusChange || imuSampleTime_ms - lastMoveCheckLogTime_ms > 200) {
lastMoveCheckLogTime_ms = imuSampleTime_ms;
#if HAL_LOGGING_ENABLED
const struct log_XKFM pkt{
LOG_PACKET_HEADER_INIT(LOG_XKFM_MSG),
time_us : dal.micros64(),
@ -1405,6 +1406,7 @@ void NavEKF3_core::updateMovementCheck(void)
accel_diff_ratio : float(accel_diff_ratio),
};
AP::logger().WriteBlock(&pkt, sizeof(pkt));
#endif
}
}