Compact debug.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-27 22:07:15 +02:00
parent 815e865ced
commit 286858c907

View File

@@ -51,12 +51,14 @@ extern int register_app(app_t * (*)());
#define DEBUG_DATA(_p, _s) \ #define DEBUG_DATA(_p, _s) \
{ \ { \
printf("Data %s (%d bytes):\r\n", #_p, _s); \ printf("Data %s (%d bytes):\r\n", #_p, _s); \
char *tmp = (char *)calloc(1, 2 * _s + 1); \
for (int _i = 0; _i < _s; _i++) \ for (int _i = 0; _i < _s; _i++) \
{ \ { \
printf("%02X", (_p)[_i]); \ sprintf(&tmp[2 * _i], "%02X", (_p)[_i]); \
} \ } \
printf("\n"); \ printf("%s\n", tmp); \
} free(tmp); \
}
#else #else
#define DEBUG_PAYLOAD(_p,_s) #define DEBUG_PAYLOAD(_p,_s)