From 96588ab13e321287ed5e4be80386943ec6f04161 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Mon, 13 Jan 2014 23:15:04 +0100 Subject: [PATCH] OP-1122 OP-1145 fixed logging helper as per review +review OPReview-604 --- flight/uavtalk/uavtalk.c | 9 +++++++-- ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/flight/uavtalk/uavtalk.c b/flight/uavtalk/uavtalk.c index 001fac196..f4909aca7 100644 --- a/flight/uavtalk/uavtalk.c +++ b/flight/uavtalk/uavtalk.c @@ -36,9 +36,14 @@ #if defined UAV_DEBUGLOG && defined FLASH_FREERTOS #define UAVT_DEBUGLOG_PRINTF(...) PIOS_DEBUGLOG_Printf(__VA_ARGS__) -#define UAVT_DEBUGLOG_CPRINTF(objId, ...) if (objId == 0x5E5903CC) { UAVT_DEBUGLOG_PRINTF(__VA_ARGS__); } -#else +// uncomment and adapt the following lines to filter verbose logging to include specific object(s) only +//#include "flighttelemetrystats.h" +//#define UAVT_DEBUGLOG_CPRINTF(objId, ...) if (objId == FLIGHTTELEMETRYSTATS_OBJID) { UAVT_DEBUGLOG_PRINTF(__VA_ARGS__); } +#endif +#ifndef UAVT_DEBUGLOG_PRINTF #define UAVT_DEBUGLOG_PRINTF(...) +#endif +#ifndef UAVT_DEBUGLOG_CPRINTF #define UAVT_DEBUGLOG_CPRINTF(objId, ...) #endif diff --git a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp index 890922116..1c7a33322 100644 --- a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp +++ b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp @@ -34,7 +34,12 @@ #include #ifdef VERBOSE_UAVTALK -#define VERBOSE_FILTER(objId) if (objId == 0x173E3850 || objId == 0x99C63292) +// uncomment and adapt the following lines to filter verbose logging to include specific object(s) only +//#include "flighttelemetrystats.h" +//#define VERBOSE_FILTER(objId) if (objId == FlightTelemetryStats::OBJID) +#endif +#ifndef VERBOSE_FILTER +#define VERBOSE_FILTER(objId) #endif #define SYNC_VAL 0x3C