From 5f7af390eca76f960bdc4b6fa83a4e33160bf1e1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 23 May 2016 10:10:29 +1000 Subject: [PATCH] AP_Common: a useful debug macro for SITL --- libraries/AP_Common/AP_Common.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/AP_Common/AP_Common.h b/libraries/AP_Common/AP_Common.h index 4346e7196f..6b8ae626f8 100644 --- a/libraries/AP_Common/AP_Common.h +++ b/libraries/AP_Common/AP_Common.h @@ -147,3 +147,12 @@ bool is_bounded_int32(int32_t value, int32_t lower_bound, int32_t upper_bound); #include #endif +/* + useful debugging macro for SITL + */ +#if CONFIG_HAL_BOARD == HAL_BOARD_SITL +#define SITL_printf(fmt, args ...) do { ::printf("%s(%u): " fmt, __FILE__, __LINE__, ##args); } while(0) +#else +#define SITL_printf(fmt, args ...) +#endif +