2022-12-31 22:50:41 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AP_HAL/AP_HAL_Boards.h>
|
|
|
|
#include <AP_Filesystem/AP_Filesystem_config.h>
|
2024-02-14 20:40:29 -04:00
|
|
|
#include <GCS_MAVLink/GCS_config.h>
|
2022-12-31 22:50:41 -04:00
|
|
|
|
|
|
|
#ifndef HAL_LOGGING_ENABLED
|
|
|
|
#define HAL_LOGGING_ENABLED 1
|
|
|
|
#endif
|
|
|
|
|
2023-09-05 10:08:30 -03:00
|
|
|
#ifndef HAL_LOGGING_BACKEND_DEFAULT_ENABLED
|
|
|
|
#define HAL_LOGGING_BACKEND_DEFAULT_ENABLED HAL_LOGGING_ENABLED
|
|
|
|
#endif
|
|
|
|
|
2022-12-31 22:50:41 -04:00
|
|
|
// set default for HAL_LOGGING_DATAFLASH_ENABLED
|
|
|
|
#ifndef HAL_LOGGING_DATAFLASH_ENABLED
|
2023-09-05 10:08:30 -03:00
|
|
|
#define HAL_LOGGING_DATAFLASH_ENABLED HAL_LOGGING_BACKEND_DEFAULT_ENABLED && (CONFIG_HAL_BOARD == HAL_BOARD_SITL)
|
2022-12-31 22:50:41 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAL_LOGGING_MAVLINK_ENABLED
|
2024-02-14 20:40:29 -04:00
|
|
|
#define HAL_LOGGING_MAVLINK_ENABLED HAL_LOGGING_BACKEND_DEFAULT_ENABLED && HAL_GCS_ENABLED
|
2022-12-31 22:50:41 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAL_LOGGING_FILESYSTEM_ENABLED
|
2023-09-05 10:08:30 -03:00
|
|
|
#define HAL_LOGGING_FILESYSTEM_ENABLED HAL_LOGGING_BACKEND_DEFAULT_ENABLED && AP_FILESYSTEM_FILE_WRITING_ENABLED
|
2022-12-31 22:50:41 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HAL_LOGGING_DATAFLASH_ENABLED
|
2024-02-25 20:27:02 -04:00
|
|
|
#define HAL_LOGGING_BLOCK_ENABLED HAL_LOGGING_ENABLED
|
2022-12-31 22:50:41 -04:00
|
|
|
#else
|
|
|
|
#define HAL_LOGGING_BLOCK_ENABLED 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-25 20:27:02 -04:00
|
|
|
#ifndef HAL_LOGGING_FLASH_W25NXX_ENABLED
|
|
|
|
#define HAL_LOGGING_FLASH_W25NXX_ENABLED HAL_LOGGING_BLOCK_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAL_LOGGING_FLASH_JEDEC_ENABLED
|
|
|
|
#define HAL_LOGGING_FLASH_JEDEC_ENABLED HAL_LOGGING_BLOCK_ENABLED
|
|
|
|
#endif
|
|
|
|
|
2022-12-31 22:50:41 -04:00
|
|
|
#if HAL_LOGGING_FILESYSTEM_ENABLED
|
|
|
|
|
|
|
|
#if !defined (HAL_BOARD_LOG_DIRECTORY)
|
|
|
|
#error Need HAL_BOARD_LOG_DIRECTORY for filesystem backend support
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAL_LOGGER_FILE_CONTENTS_ENABLED
|
|
|
|
#define HAL_LOGGER_FILE_CONTENTS_ENABLED HAL_LOGGING_FILESYSTEM_ENABLED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// range of IDs to allow for new messages during replay. It is very
|
|
|
|
// useful to be able to add new messages during a replay, but we need
|
|
|
|
// to avoid colliding with existing messages
|
|
|
|
#define REPLAY_LOG_NEW_MSG_MAX 230
|
|
|
|
#define REPLAY_LOG_NEW_MSG_MIN 220
|
|
|
|
|
|
|
|
#include <AC_Fence/AC_Fence_config.h>
|
2023-09-04 07:05:11 -03:00
|
|
|
#define HAL_LOGGER_FENCE_ENABLED HAL_LOGGING_ENABLED && AP_FENCE_ENABLED
|
|
|
|
|
|
|
|
#include <AP_Rally/AP_Rally_config.h>
|
|
|
|
#define HAL_LOGGER_RALLY_ENABLED HAL_LOGGING_ENABLED && HAL_RALLY_ENABLED
|