]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/lfops.c
create Dbprintf convenience function
[proxmark3-svn] / armsrc / lfops.c
index eeaa5782948173f2cf6af575551d4915e1dc2b11..7ba0ad130918333fd314391e6206884cb92d9199 100644 (file)
@@ -39,7 +39,6 @@ void DoAcquisition125k(void)
        BYTE *dest = (BYTE *)BigBuf;\r
        int n = sizeof(BigBuf);\r
        int i;\r
-       char output_string[64];\r
        \r
        memset(dest, 0, n);\r
        i = 0;\r
@@ -55,9 +54,7 @@ void DoAcquisition125k(void)
                        if (i >= n) break;\r
                }\r
        }\r
-       sprintf(output_string, "read samples, dest[0]=%x dest[1]=%x",\r
-               dest[0], dest[1]);\r
-       DbpString(output_string);\r
+       Dbprintf("read samples, dest[0]=%x dest[1]=%x", dest[0], dest[1]);\r
 }\r
 \r
 void ModThenAcquireRawAdcSamples125k(int delay_off, int period_0, int period_1, BYTE *command)\r
@@ -251,13 +248,10 @@ void ReadTItag(void)
                crc = update_crc16(crc, (shift1>>16)&0xff);\r
                crc = update_crc16(crc, (shift1>>24)&0xff);\r
 \r
-               char output_string[64];\r
-               sprintf(output_string, "Info: Tag data_hi=%x, data_lo=%x, crc=%x",\r
+               Dbprintf("Info: Tag data_hi=%x, data_lo=%x, crc=%x",\r
                        (unsigned int)shift1, (unsigned int)shift0, (unsigned int)shift2 & 0xFFFF);\r
-               DbpString(output_string);\r
                if (crc != (shift2&0xffff)) {\r
-                       sprintf(output_string, "Error: CRC mismatch, expected %x", (unsigned int)crc);\r
-                       DbpString(output_string);\r
+                       Dbprintf("Error: CRC mismatch, expected %x", (unsigned int)crc);\r
                } else {\r
                        DbpString("Info: CRC is good");\r
                }\r
@@ -380,10 +374,8 @@ void WriteTItag(DWORD idhi, DWORD idlo, WORD crc)
                crc = update_crc16(crc, (idhi>>16)&0xff);\r
                crc = update_crc16(crc, (idhi>>24)&0xff);\r
        }\r
-       char output_string[64];\r
-       sprintf(output_string, "Writing the following data to tag: %x, %x, %x",\r
+       Dbprintf("Writing the following data to tag: %x, %x, %x",\r
                (unsigned int) idhi, (unsigned int) idlo, crc);\r
-       DbpString(output_string);\r
 \r
        // TI tags charge at 134.2Khz\r
        FpgaSendCommand(FPGA_CMD_SET_DIVISOR, 88); //134.8Khz\r
@@ -927,10 +919,8 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
-                                       char output_string[64];\r
-                                       sprintf(output_string, "TAG ID: %x %x %x", \r
+                                       Dbprintf("TAG ID: %x %x %x", \r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
-                                       DbpString(output_string);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
                                        {\r
@@ -962,10 +952,8 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
-                                       char output_string[64];\r
-                                       sprintf(output_string, "TAG ID: %x %x %x", \r
+                                       Dbprintf("TAG ID: %x %x %x", \r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
-                                       DbpString(output_string);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
                                        {\r
Impressum, Datenschutz