From 27d33775dc2a6e3ace23ad45830275a71b40c218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 16 Apr 2014 02:02:50 +0200 Subject: [PATCH] Don't make me think! --- libfreefare/freefare_internal.h | 2 ++ libfreefare/mifare_desfire.c | 1 + 2 files changed, 3 insertions(+) diff --git a/libfreefare/freefare_internal.h b/libfreefare/freefare_internal.h index c95dd2a..77cb1fd 100644 --- a/libfreefare/freefare_internal.h +++ b/libfreefare/freefare_internal.h @@ -286,8 +286,10 @@ struct mifare_ultralight_tag { #define TB_AB(ab) ((ab == C_DEFAULT) ? C_100 : ab) #ifdef WITH_DEBUG +#define DEBUG_FUNCTION() do { printf("*** \033[033;1m%s\033[0m ***\n", __FUNCTION__); } while (0) #define DEBUG_XFER(data, nbytes, hint) do { hexdump (data, nbytes, hint, 0); } while (0) #else +#define DEBUG_FUNCTION() do {} while (0) #define DEBUG_XFER(data, nbytes, hint) do {} while (0) #endif diff --git a/libfreefare/mifare_desfire.c b/libfreefare/mifare_desfire.c index 6225c9c..edf1707 100644 --- a/libfreefare/mifare_desfire.c +++ b/libfreefare/mifare_desfire.c @@ -166,6 +166,7 @@ static ssize_t read_data (MifareTag tag, uint8_t command, uint8_t file_no, off_ */ #define DESFIRE_TRANSCEIVE2(tag, msg, msg_len, res) \ do { \ + DEBUG_FUNCTION(); \ static uint8_t __msg[MAX_CAPDU_SIZE + 5] = { 0x90, 0x00, 0x00, 0x00, 0x00, /* ..., */ 0x00 }; \ /* CLA INS P1 P2 Lc PAYLOAD LE*/ \ static uint8_t __res[MAX_RAPDU_SIZE + 1]; \