mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
AP_Logger: allow compilation with HAL_LOGGING_ENABLED false
This commit is contained in:
parent
5ae4355e26
commit
486cbb7890
@ -5,6 +5,8 @@
|
||||
|
||||
#include "AP_Logger_config.h"
|
||||
|
||||
#if HAL_LOGGING_ENABLED
|
||||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include <AP_Common/AP_Common.h>
|
||||
#include <AP_Param/AP_Param.h>
|
||||
@ -609,3 +611,13 @@ private:
|
||||
namespace AP {
|
||||
AP_Logger &logger();
|
||||
};
|
||||
|
||||
#define LOGGER_WRITE_ERROR(subsys, err) AP::logger().Write_Error(subsys, err)
|
||||
#define LOGGER_WRITE_EVENT(evt) AP::logger().Write_Event(evt)
|
||||
|
||||
#else
|
||||
|
||||
#define LOGGER_WRITE_ERROR(subsys, err)
|
||||
#define LOGGER_WRITE_EVENT(evt)
|
||||
|
||||
#endif // HAL_LOGGING_ENABLED
|
||||
|
@ -17,13 +17,15 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <GCS_MAVLink/GCS_config.h>
|
||||
#include <AP_Logger/AP_Logger_config.h>
|
||||
|
||||
#if HAL_LOGGING_ENABLED && HAL_GCS_ENABLED
|
||||
|
||||
#include <AP_HAL/AP_HAL.h>
|
||||
#include <AP_Logger/AP_Logger.h>
|
||||
#include <GCS_MAVLink/GCS.h> // for LOG_ENTRY
|
||||
|
||||
#if HAL_GCS_ENABLED
|
||||
|
||||
extern const AP_HAL::HAL& hal;
|
||||
|
||||
/**
|
||||
@ -327,4 +329,4 @@ bool AP_Logger::handle_log_send_data()
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // HAL_LOGGING_ENABLED && HAL_GCS_ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user