From 5edb8d14272ea2ecd9784a26e150a45954d67e2e Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 5 Aug 2015 19:27:19 +0200 Subject: Introduce API debugging --- private.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'private.h') diff --git a/private.h b/private.h index 4bbd937..9557ad4 100644 --- a/private.h +++ b/private.h @@ -14,6 +14,7 @@ # define IPECAMERA_DEBUG_RAW_PACKETS //**< Store all raw packets read from DMA grouped in frames */ # define IPECAMERA_DEBUG_HARDWARE //**< Produce various debugging information about ipecamera operation */ # define IPECAMERA_DEBUG_FRAME_HEADERS //**< Print frame headers & footers */ +# define IPECAMERA_DEBUG_API //**< Debug IPECamera API calls */ #endif /* IPECAMERA_DEBUG */ #define IPECAMERA_BUG_MISSING_PAYLOAD //**< CMOSIS fails to provide a first payload for each frame, therefore the frame is 32 bit shorter */ @@ -108,6 +109,14 @@ # define IPECAMERA_DEBUG_FRAME_HEADERS_BUFFER(function, ...) #endif /* IPECAMERA_DEBUG_RAW_FRAMES */ +#ifdef IPECAMERA_DEBUG_API +# define IPECAMERA_DEBUG_API_MESSAGE(function, ...) if (ipecamera_getenv(function##_ENV, #function)) { pcilib_debug_message (#function, __FILE__, __LINE__, __VA_ARGS__); } +# define IPECAMERA_DEBUG_API_BUFFER(function, ...) if (ipecamera_getenv(function##_ENV, #function)) { pcilib_debug_data_buffer (#function, __VA_ARGS__); } +#else /* IPECAMERA_DEBUG_API */ +# define IPECAMERA_DEBUG_API_MESSAGE(function, ...) +# define IPECAMERA_DEBUG_API_BUFFER(function, ...) +#endif /* IPECAMERA_DEBUG_API */ + #define ipecamera_debug(function, ...) \ IPECAMERA_DEBUG_##function##_MESSAGE(IPECAMERA_DEBUG_##function, PCILIB_LOG_DEFAULT, __VA_ARGS__) -- cgit v1.2.3