AP_VisualOdom: only include log structure if enabled

This commit is contained in:
Iampete1 2022-07-06 11:04:19 +01:00 committed by Andrew Tridgell
parent 71b00e0f75
commit 8afc07d85b
3 changed files with 13 additions and 6 deletions

View File

@ -14,11 +14,7 @@
*/
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_VISUALODOM_ENABLED
#define HAL_VISUALODOM_ENABLED (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif
#include "AP_VisualOdom_config.h"
#if HAL_VISUALODOM_ENABLED

View File

@ -0,0 +1,7 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef HAL_VISUALODOM_ENABLED
#define HAL_VISUALODOM_ENABLED (!HAL_MINIMIZE_FEATURES && BOARD_FLASH_SIZE > 1024)
#endif

View File

@ -1,6 +1,7 @@
#pragma once
#include <AP_Logger/LogStructure.h>
#include "AP_VisualOdom_config.h"
#define LOG_IDS_FROM_VISUALODOM \
LOG_VISUALODOM_MSG, \
@ -87,6 +88,7 @@ struct PACKED log_VisualVelocity {
uint8_t ignored;
};
#if HAL_VISUALODOM_ENABLED
#define LOG_STRUCTURE_FROM_VISUALODOM \
{ LOG_VISUALODOM_MSG, sizeof(log_VisualOdom), \
"VISO", "Qffffffff", "TimeUS,dt,AngDX,AngDY,AngDZ,PosDX,PosDY,PosDZ,conf", "ssrrrmmm-", "FF000000-" }, \
@ -94,4 +96,6 @@ struct PACKED log_VisualVelocity {
"VISP", "QQIffffffffBB", "TimeUS,RTimeUS,CTimeMS,PX,PY,PZ,Roll,Pitch,Yaw,PErr,AErr,Rst,Ign", "sssmmmddhmd--", "FFC00000000--" }, \
{ LOG_VISUALVEL_MSG, sizeof(log_VisualVelocity), \
"VISV", "QQIffffBB", "TimeUS,RTimeUS,CTimeMS,VX,VY,VZ,VErr,Rst,Ign", "sssnnnn--", "FFC0000--" },
#else
#define LOG_STRUCTURE_FROM_VISUALODOM
#endif