param.h type checking more info

This commit is contained in:
Daniel Agar
2021-11-19 15:51:55 -05:00
parent 3f5b7d9e36
commit e997a5f384
+7 -1
View File
@@ -448,10 +448,16 @@ __END_DECLS
#if defined(__cplusplus) && !defined(PARAM_IMPLEMENTATION)
#if 1 // set to 1 to debug param type mismatches
#include <cstdio>
#include <px4_platform_common/log.h>
#ifndef MODULE_NAME
#define MODULE_NAME "px4"
#endif
#define CHECK_PARAM_TYPE(param, type) \
if (param_type(param) != type) { \
/* use printf() to avoid having to use more includes */ \
printf("wrong type passed to param_get() for param %s\n", param_name(param)); \
PX4_ERR("wrong type passed to param_get() for param %s", param_name(param)); \
}
#else
#define CHECK_PARAM_TYPE(param, type)