X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/76c7e6c36368c3fc23dc4fab1fe5852023c78fac..7bd30f12ac6def96c82df20ed7d927160db289af:/armsrc/appmain.c diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 6f8b0150..afed56b7 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -18,9 +18,9 @@ #include "util.h" #include "printf.h" #include "string.h" - #include + #include "legicrf.h" #include "../include/hitag2.h" @@ -597,7 +597,7 @@ void UsbPacketReceived(uint8_t *packet, int len) { UsbCommand *c = (UsbCommand *)packet; -// Dbprintf("received %d bytes, with command: 0x%04x and args: %d %d %d",len,c->cmd,c->arg[0],c->arg[1],c->arg[2]); + //Dbprintf("received %d bytes, with command: 0x%04x and args: %d %d %d",len,c->cmd,c->arg[0],c->arg[1],c->arg[2]); switch(c->cmd) { #ifdef WITH_LF @@ -842,14 +842,18 @@ void UsbPacketReceived(uint8_t *packet, int len) MifareDES_Auth1(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes); break; case CMD_MIFARE_DESFIRE_AUTH2: - MifareDES_Auth2(c->arg[0],c->d.asBytes); + //MifareDES_Auth2(c->arg[0],c->d.asBytes); break; // case CMD_MIFARE_DES_READER: // ReaderMifareDES(c->arg[0], c->arg[1], c->d.asBytes); - break; + //break; case CMD_MIFARE_DESFIRE_INFO: MifareDesfireGetInformation(); break; + case CMD_MIFARE_DESFIRE: + MifareSendCommand(c->arg[0], c->arg[1], c->d.asBytes); + break; + #endif #ifdef WITH_ICLASS @@ -993,8 +997,8 @@ void __attribute__((noreturn)) AppMain(void) LED_B_OFF(); LED_A_OFF(); - // Init USB device` - usb_enable(); + // Init USB device + usb_enable(); // The FPGA gets its clock from us from PCK0 output, so set that up. AT91C_BASE_PIOA->PIO_BSR = GPIO_PCK0; @@ -1024,12 +1028,12 @@ void __attribute__((noreturn)) AppMain(void) size_t rx_len; for(;;) { - if (usb_poll()) { - rx_len = usb_read(rx,sizeof(UsbCommand)); - if (rx_len) { - UsbPacketReceived(rx,rx_len); - } - } + if (usb_poll()) { + rx_len = usb_read(rx,sizeof(UsbCommand)); + if (rx_len) { + UsbPacketReceived(rx,rx_len); + } + } WDT_HIT(); #ifdef WITH_LF