AP_Common: a useful debug macro for SITL

This commit is contained in:
Andrew Tridgell 2016-05-23 10:10:29 +10:00
parent ef210217dd
commit 5f7af390ec
1 changed files with 9 additions and 0 deletions

View File

@ -147,3 +147,12 @@ bool is_bounded_int32(int32_t value, int32_t lower_bound, int32_t upper_bound);
#include <AP_HAL_QURT/replace.h>
#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