diff --git a/libraries/AP_DAL/AP_DAL.cpp b/libraries/AP_DAL/AP_DAL.cpp index b05c411e5d..986fe66bcf 100644 --- a/libraries/AP_DAL/AP_DAL.cpp +++ b/libraries/AP_DAL/AP_DAL.cpp @@ -38,11 +38,13 @@ void AP_DAL::start_frame(AP_DAL::FrameType frametype) _last_imu_time_us = imu_us; // we force write all msgs when logging starts +#if HAL_LOGGING_ENABLED bool logging = AP::logger().logging_started() && AP::logger().allow_start_ekf(); if (logging && !logging_started) { force_write = true; } logging_started = logging; +#endif end_frame(); @@ -280,6 +282,7 @@ uint8_t AP_DAL::logging_core(uint8_t c) const #endif } +#if HAL_LOGGING_ENABLED // write out a DAL log message. If old_msg is non-null, then // only write if the content has changed void AP_DAL::WriteLogMessage(enum LogMessages msg_type, void *msg, const void *old_msg, uint8_t msg_size) @@ -301,6 +304,7 @@ void AP_DAL::WriteLogMessage(enum LogMessages msg_type, void *msg, const void *o _end = 0; } } +#endif /* check if we are low on CPU for this core. This needs to capture the diff --git a/libraries/AP_DAL/AP_DAL.h b/libraries/AP_DAL/AP_DAL.h index 671499b547..d8c92e01b5 100644 --- a/libraries/AP_DAL/AP_DAL.h +++ b/libraries/AP_DAL/AP_DAL.h @@ -324,9 +324,11 @@ public: // map core number for replay uint8_t logging_core(uint8_t c) const; +#if HAL_LOGGING_ENABLED // write out a DAL log message. If old_msg is non-null, then // only write if the content has changed static void WriteLogMessage(enum LogMessages msg_type, void *msg, const void *old_msg, uint8_t msg_size); +#endif private: @@ -376,10 +378,15 @@ private: bool init_done; }; +#if HAL_LOGGING_ENABLED #define WRITE_REPLAY_BLOCK(sname,v) AP_DAL::WriteLogMessage(LOG_## sname ##_MSG, &v, nullptr, offsetof(log_ ##sname, _end)) #define WRITE_REPLAY_BLOCK_IFCHANGED(sname,v,old) do { static_assert(sizeof(v) == sizeof(old), "types must match"); \ AP_DAL::WriteLogMessage(LOG_## sname ##_MSG, &v, &old, offsetof(log_ ##sname, _end)); } \ while (0) +#else +#define WRITE_REPLAY_BLOCK(sname,v) do { (void)v; } while (false) +#define WRITE_REPLAY_BLOCK_IFCHANGED(sname,v,old) do { (void)old; } while (false) +#endif namespace AP { AP_DAL &dal();