]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fixed some compile warnings in client, minor tidy up with some dbprintf statements
authord18c7db <d18c7db@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 4 Jan 2010 03:08:45 +0000 (03:08 +0000)
committerd18c7db <d18c7db@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Mon, 4 Jan 2010 03:08:45 +0000 (03:08 +0000)
armsrc/appmain.c
armsrc/apps.h
armsrc/example_lcd.c [deleted file]
armsrc/lfops.c
client/Makefile
client/prox.c

index 6273317e8f8983b7fe36e091afe7fe95fd68e79f..237159c94b4691eab97bc662af5fb6efdfb5ecad 100644 (file)
@@ -252,7 +252,7 @@ void ReadMem(int addr)
 {\r
        const DWORD *data = ((DWORD *)addr);\r
 \r
 {\r
        const DWORD *data = ((DWORD *)addr);\r
 \r
-       Dbprintf("Reading memory at address %x: %02x %02x %02x %02x %02x %02x %02x %02x",\r
+       Dbprintf("%x: %02x %02x %02x %02x %02x %02x %02x %02x",\r
                addr, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);\r
 }\r
 \r
                addr, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);\r
 }\r
 \r
index b15ae6ad5c55cb7bcc85dcda7f846474f5947e24..308c378555f39c0b5420b5df02a21df03e3fee5c 100644 (file)
@@ -19,7 +19,7 @@ DWORD BigBuf[12000];
 void ReadMem(int addr);\r
 void __attribute__((noreturn)) AppMain(void);\r
 void SamyRun(void);\r
 void ReadMem(int addr);\r
 void __attribute__((noreturn)) AppMain(void);\r
 void SamyRun(void);\r
-void DbpIntegers(int a, int b, int c);\r
+//void DbpIntegers(int a, int b, int c);\r
 void DbpString(char *str);\r
 void Dbprintf(const char *fmt, ...);\r
 \r
 void DbpString(char *str);\r
 void Dbprintf(const char *fmt, ...);\r
 \r
diff --git a/armsrc/example_lcd.c b/armsrc/example_lcd.c
deleted file mode 100644 (file)
index a2267ba..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-unsigned char somestring[25];\r
-\r
-//*********************************************************************\r
-//********************  SYSTERM HEARTBEAT @ 10 ms *********************\r
-//*********************************************************************\r
-void InitSPI (void)\r
-{\r
-  //set functionalite to pins:\r
-  //port0.11 -> NPCS0\r
-  //port0.12 -> MISO\r
-  //port0.13 -> MOSI\r
-  //port0.14 -> SPCK\r
-  PIOA_PDR = BIT11 | BIT12 | BIT13 | BIT14;\r
-  PIOA_ASR = BIT11 | BIT12 | BIT13 | BIT14;\r
-  PIOA_BSR = 0;\r
-\r
-\r
-  PMC_PCER |= 1 << 5; // Enable SPI timer clock.\r
-\r
-  /****  Fixed mode ****/\r
-  SPI_CR   = 0x81;                                     //SPI Enable, Sowtware reset\r
-  SPI_CR   = 0x01;                                     //SPI Enable\r
-\r
-\r
-\r
-  SPI_MR       = 0x000E0011;                           //Master mode\r
-  SPI_CSR0     = 0x01010B11;                           //9 bit\r
-\r
-}\r
-\r
-//*********************************************************************\r
-//***************************  Task 1  ********************************\r
-//*********************************************************************\r
-void Task_1(void *p)\r
-{\r
-    char beat=0;                                    // just flash the onboard LED for Heatbeat\r
-\r
-    while(1)\r
-    {\r
-       if(beat)\r
-       {\r
-            PIOA_SODR = BIT18;\r
-            beat=0;\r
-       }\r
-       else\r
-       {\r
-            PIOA_CODR = BIT18;\r
-            beat=1;\r
-       }\r
-\r
-       ctl_timeout_wait(ctl_get_current_time()+ 150);\r
-\r
-    }\r
-}\r
-//*********************************************************************\r
-//***************************  Task 2  ********************************\r
-//*********************************************************************\r
-void Task_2(void *p)\r
-{\r
-    unsigned long z;\r
-    unsigned int x,y;\r
-    unsigned char a,b,c,d,e;\r
-\r
-    char seconds,minutes,hours;\r
-\r
-    unsigned int nowold,tenths;\r
-\r
-\r
-    InitLCD();\r
-\r
-\r
-/*******  Put smiley face up in 4096 color mode  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    LCD_Set_Resolution(HIGH_RES);                        // set 4096 color mode\r
-\r
-//    ShowImage_4096(0,0,smiley);\r
-    LCD_Set_Resolution(LOW_RES);                        // set 256 color mode\r
-\r
-    ctl_timeout_wait(ctl_get_current_time()+ 4000);     // wait 4 seconds to view it\r
-\r
-/*******  Do some static on screen  *******/\r
-\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    for(z=0;z<100000;z++)\r
-    {\r
-        while( (a = rand()) > 132);\r
-        while( (b = rand()) > 132);\r
-        c = rand();\r
-        LCD_PixelPut(a,b,c);\r
-    }\r
-\r
-/*******  Do some lines on screen  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    for(z=1;z<300;z++)\r
-    {\r
-        while( (a = rand()) > 132);\r
-        while( (b = rand()) > 132);\r
-        while( (c = rand()) > 132);\r
-        while( (d = rand()) > 132);\r
-        e = rand();                                 // pick color\r
-\r
-        LCD_Line(a,b,c,d,e);\r
-       ctl_timeout_wait(ctl_get_current_time()+ 10);\r
-    }\r
-\r
-/*******  Do some Boxes on screen  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    for(z=0;z<300;z++)\r
-    {\r
-\r
-        while( (a = rand()) > 132);\r
-        while( (b = rand()) > 132);\r
-        while( (c = rand()) > 132);\r
-        while( (d = rand()) > 132);\r
-\r
-        e = rand();                                 // pick color\r
-        LCD_Box(a,b,c,d,e);\r
-\r
-        ctl_timeout_wait(ctl_get_current_time()+ 10);\r
-    }\r
-/*******  Do some Circles on screen  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    for(z=0;z<100;z++)\r
-    {\r
-\r
-        while( (a = rand()) > 132);\r
-        while( (b = rand()) > 132);\r
-        while( (c = rand()) > 127);                 // diameter\r
-\r
-        d = rand();                                 // pick color\r
-        LCD_Circle(a,b,c,d);\r
-\r
-        ctl_timeout_wait(ctl_get_current_time()+ 10);\r
-    }\r
-\r
-/*******  Do some Thick Circles on screen  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    for(z=0;z<25;z++)\r
-    {\r
-        while( (a = rand()) > 132);\r
-        while( (b = rand()) > 132);\r
-        while( (c = rand()) > 40);                 // diameter\r
-        while( (d = rand()) > 10);                 // wall thicknes\r
-        e = rand();                                 // pick color\r
-        LCD_Thick_Circle(a,b,c,d,e);\r
-\r
-        ctl_timeout_wait(ctl_get_current_time()+ 1);\r
-    }\r
-\r
-/*******  Do something funky to wipe screen  *******/\r
-       b=0;\r
-\r
-       for(a=0;a<131;a++)\r
-       {\r
-            LCD_Line(a,b,65,65,0x62);\r
-       }\r
-       for(b=0;b<131;b++)\r
-       {\r
-            LCD_Line(a,b,65,65,0x62);\r
-       }\r
-       for(;a>1;a--)\r
-       {\r
-            LCD_Line(a,b,65,65,0x62);\r
-       }\r
-       for(;b>1;b--)\r
-       {\r
-            LCD_Line(a,b,65,65,0x62);\r
-       }\r
-\r
-       ctl_timeout_wait(ctl_get_current_time()+ 1000);\r
-\r
-/*******  Show Image scrolling *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    ShowImage(0,50,sparkfun);\r
-\r
-    sprintf(somestring,"Thanks SparkFun");\r
-    LCD_String(somestring,&FONT8x8F[0][0],5,10,LightGreen,Black);\r
-\r
-    ctl_timeout_wait(ctl_get_current_time()+ 2000);     // hold sparkfun image for a bit\r
-\r
-    for(y=50;y<140;y++)\r
-    {\r
-        LCD_Line(0,y-1,132,y-1,Black);                  // wipe the white line as it moves down\r
-       ShowImage(0,y,sparkfun);                        // move image to Y location\r
-       ctl_timeout_wait(ctl_get_current_time()+ 25);   // wait a bit\r
-    }\r
-\r
-/*******  Run radar in loop with example fonts displayed  *******/\r
-    LCD_Fill(0,0,132,132,Black);\r
-\r
-    LCD_Thick_Circle(66,66,30,2,DarkBlue);\r
-\r
-    y=0;\r
-\r
-    while (1)\r
-    {\r
-       LCD_Circle_Line(66,66,28,0,y,LightGreen);\r
-\r
-       ctl_timeout_wait(ctl_get_current_time()+ 1);\r
-\r
-       tenths = ctl_current_time / 1000;\r
-\r
-       if(tenths != nowold)\r
-       {\r
-            nowold = tenths;\r
-\r
-            if(++seconds == 60)\r
-            {\r
-                seconds = 0;\r
-\r
-                if(++minutes == 60)\r
-                {\r
-                    minutes=0;\r
-                    hours++;\r
-               }\r
-            }\r
-       }\r
-\r
-\r
-       printf("a=%6lu - b=%6lu - c=%6lu - d=%6lu  :  Time=%lu\r\n",a,b,c,d,ctl_current_time);\r
-\r
-       sprintf(somestring,"%05lu",y);\r
-       LCD_String(somestring,&FONT6x8[0][0],52,25,White,Black);\r
-\r
-       sprintf(somestring,"Time:%02u:%02u:%02u",hours,minutes,seconds);\r
-       LCD_String(somestring,&FONT8x8F[0][0],14,10,DarkRed,Black);\r
-\r
-       sprintf(somestring,"Time:%02u:%02u:%02u",hours,minutes,seconds);\r
-       LCD_String(somestring,&FONT8x16[0][0],14,115,LightGreen,Black);\r
-\r
-       LCD_Circle_Line(66,66,28,0,y,Black);\r
-\r
-        if(++y==360)\r
-        {\r
-            y=0;\r
-        }\r
-\r
-       ctl_timeout_wait(ctl_get_current_time()+ 10);\r
-\r
-    }\r
-}\r
-\r
-/*************************************************************************\r
- *********************        Main Module        *************************\r
- *********************                           *************************\r
- *********************     Initialize Program    *************************\r
- *********************         Sequences         *************************\r
- *********************                           *************************\r
- *************************************************************************/\r
-int main(void)\r
-{\r
-       BoardInit();\r
-\r
-       InitSPI();\r
-\r
-       while (1)\r
-       {\r
-            Idle();\r
-       }\r
-\r
-       return 0;\r
-}\r
index 7ba0ad130918333fd314391e6206884cb92d9199..c94490892430c89703b7f95f1879d064520fbc17 100644 (file)
@@ -54,7 +54,8 @@ void DoAcquisition125k(void)
                        if (i >= n) break;\r
                }\r
        }\r
                        if (i >= n) break;\r
                }\r
        }\r
-       Dbprintf("read samples, dest[0]=%x dest[1]=%x", dest[0], dest[1]);\r
+       Dbprintf("buffer samples: %02x %02x %02x %02x %02x %02x %02x %02x ...",\r
+                       dest[0], dest[1], dest[2], dest[3], dest[4], dest[5], dest[6], dest[7]);\r
 }\r
 \r
 void ModThenAcquireRawAdcSamples125k(int delay_off, int period_0, int period_1, BYTE *command)\r
 }\r
 \r
 void ModThenAcquireRawAdcSamples125k(int delay_off, int period_0, int period_1, BYTE *command)\r
@@ -248,7 +249,7 @@ void ReadTItag(void)
                crc = update_crc16(crc, (shift1>>16)&0xff);\r
                crc = update_crc16(crc, (shift1>>24)&0xff);\r
 \r
                crc = update_crc16(crc, (shift1>>16)&0xff);\r
                crc = update_crc16(crc, (shift1>>24)&0xff);\r
 \r
-               Dbprintf("Info: Tag data_hi=%x, data_lo=%x, crc=%x",\r
+               Dbprintf("Info: Tag data: %x%08x, crc=%x",\r
                        (unsigned int)shift1, (unsigned int)shift0, (unsigned int)shift2 & 0xFFFF);\r
                if (crc != (shift2&0xffff)) {\r
                        Dbprintf("Error: CRC mismatch, expected %x", (unsigned int)crc);\r
                        (unsigned int)shift1, (unsigned int)shift0, (unsigned int)shift2 & 0xFFFF);\r
                if (crc != (shift2&0xffff)) {\r
                        Dbprintf("Error: CRC mismatch, expected %x", (unsigned int)crc);\r
@@ -343,7 +344,6 @@ void AcquireTiType(void)
        n = TIBUFLEN*32;\r
        // unpack buffer\r
        for (i=TIBUFLEN-1; i>=0; i--) {\r
        n = TIBUFLEN*32;\r
        // unpack buffer\r
        for (i=TIBUFLEN-1; i>=0; i--) {\r
-//             DbpIntegers(0, 0, BigBuf[i]);\r
                for (j=0; j<32; j++) {\r
                        if(BigBuf[i] & (1 << j)) {\r
                                dest[--n] = 1;\r
                for (j=0; j<32; j++) {\r
                        if(BigBuf[i] & (1 << j)) {\r
                                dest[--n] = 1;\r
@@ -359,11 +359,6 @@ void AcquireTiType(void)
 // if not provided a valid crc will be computed from the data and written.\r
 void WriteTItag(DWORD idhi, DWORD idlo, WORD crc)\r
 {\r
 // if not provided a valid crc will be computed from the data and written.\r
 void WriteTItag(DWORD idhi, DWORD idlo, WORD crc)\r
 {\r
-\r
-       // WARNING the order of the bytes in which we calc crc below needs checking\r
-       // i'm 99% sure the crc algorithm is correct, but it may need to eat the\r
-       // bytes in reverse or something\r
-\r
        if(crc == 0) {\r
                crc = update_crc16(crc, (idlo)&0xff);\r
                crc = update_crc16(crc, (idlo>>8)&0xff);\r
        if(crc == 0) {\r
                crc = update_crc16(crc, (idlo)&0xff);\r
                crc = update_crc16(crc, (idlo>>8)&0xff);\r
@@ -374,7 +369,7 @@ 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
                crc = update_crc16(crc, (idhi>>16)&0xff);\r
                crc = update_crc16(crc, (idhi>>24)&0xff);\r
        }\r
-       Dbprintf("Writing the following data to tag: %x, %x, %x",\r
+       Dbprintf("Writing to tag: %x%08x, crc=%x",\r
                (unsigned int) idhi, (unsigned int) idlo, crc);\r
 \r
        // TI tags charge at 134.2Khz\r
                (unsigned int) idhi, (unsigned int) idlo, crc);\r
 \r
        // TI tags charge at 134.2Khz\r
@@ -919,7 +914,7 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
-                                       Dbprintf("TAG ID: %x %x %x", \r
+                                       Dbprintf("TAG ID: %x%08x (%d)",\r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
@@ -952,7 +947,7 @@ void CmdHIDdemodFSK(int findone, int *high, int *low, int ledcontrol)
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
                                found=1;\r
                                idx+=6;\r
                                if (found && (hi|lo)) {\r
-                                       Dbprintf("TAG ID: %x %x %x", \r
+                                       Dbprintf("TAG ID: %x%08x (%d)",\r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
                                                (unsigned int) hi, (unsigned int) lo, (unsigned int) (lo>>1) & 0xFFFF);\r
                                        /* if we're only looking for one tag */\r
                                        if (findone)\r
index 2d516ac7624207d1a392783eb1583fa704df80fa..b8707a5ed398fc797ba775c4e95515a52b85b0f8 100644 (file)
@@ -10,6 +10,8 @@ WINLIBS = -lgdi32 -lsetupapi
 CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall
 QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
 
 CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall
 QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null)
 
+ifeq ($(shell echo ""),)
+
 ifeq ($(shell uname),Darwin)
 CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
 QTLDLIBS = -framework QtGui -framework QtCore
 ifeq ($(shell uname),Darwin)
 CXXFLAGS = -I/Library/Frameworks/QtGui.framework/Versions/Current/Headers -I/Library/Frameworks/QtCore.framework/Versions/Current/Headers
 QTLDLIBS = -framework QtGui -framework QtCore
@@ -25,7 +27,6 @@ else
 QTGUI = guidummy.o
 endif
 
 QTGUI = guidummy.o
 endif
 
-ifeq ($(shell echo ""),)
 RM = rm -f
 BINS = proxmark3 snooper cli flasher
 CLEAN = cli flasher proxmark3 snooper *.o *.moc.cpp
 RM = rm -f
 BINS = proxmark3 snooper cli flasher
 CLEAN = cli flasher proxmark3 snooper *.o *.moc.cpp
index 58704494f5b076352b1ef1b9b9a86acd52b2f93c..94343ff0222841c5d95f1b4787941466bc2fcf6e 100644 (file)
@@ -225,7 +225,7 @@ void WaitForAck(void) {
        }\r
 }\r
 \r
        }\r
 }\r
 \r
-static DWORD ExpectedAddr;\r
+static unsigned int ExpectedAddr;\r
 static BYTE QueuedToSend[256];\r
 static BOOL AllWritten;\r
 #define PHYSICAL_FLASH_START 0x100000\r
 static BYTE QueuedToSend[256];\r
 static BOOL AllWritten;\r
 #define PHYSICAL_FLASH_START 0x100000\r
@@ -336,7 +336,7 @@ static void LoadFlashFromSRecords(const char *file, int start_addr, int end_addr
                        char addrStr[9];\r
                        memcpy(addrStr, s, 8);\r
                        addrStr[8] = '\0';\r
                        char addrStr[9];\r
                        memcpy(addrStr, s, 8);\r
                        addrStr[8] = '\0';\r
-                       DWORD addr;\r
+                       unsigned int addr;\r
                        sscanf(addrStr, "%x", &addr);\r
                        s += 8;\r
 \r
                        sscanf(addrStr, "%x", &addr);\r
                        s += 8;\r
 \r
Impressum, Datenschutz