diff options
Diffstat (limited to 'include/dlt/dlt_user_macros.h')
-rw-r--r-- | include/dlt/dlt_user_macros.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/dlt/dlt_user_macros.h b/include/dlt/dlt_user_macros.h index 3bb161f..919df7e 100644 --- a/include/dlt/dlt_user_macros.h +++ b/include/dlt/dlt_user_macros.h @@ -328,6 +328,18 @@ (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16) /** + * Architecture independent macro to print pointers + */ +#define DLT_PTR(PTR_VAR) \ + do { \ + if (sizeof(void *) < 8) { \ + DLT_HEX32((uintptr_t)PTR_VAR); \ + } else { \ + DLT_HEX64((uintptr_t)PTR_VAR); \ + } \ + } while(0) + +/** * Trace network message * @param CONTEXT object containing information about one special logging context * @param TYPE type of network trace message |