From: pwpiwi Date: Fri, 13 Mar 2015 06:24:56 +0000 (+0100) Subject: Merge pull request #75 from pwpiwi/qtmakefile X-Git-Tag: show~3 X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/9185099ed8bc375fdc44af79065b5e78a7d602f3?hp=8c04722db6302494cc3fbc379a8514e27d953c84 Merge pull request #75 from pwpiwi/qtmakefile (issue #47) use Qt5 includes and libraries, if present --- diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index f2fa1ff2..ac839cfd 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1890,8 +1890,9 @@ void ReaderIso14443a(UsbCommand *c) { iso14a_command_t param = c->arg[0]; uint8_t *cmd = c->d.asBytes; - size_t len = c->arg[1]; - size_t lenbits = c->arg[2]; + size_t len = c->arg[1] & 0xffff; + size_t lenbits = c->arg[1] >> 16; + uint32_t timeout = c->arg[2]; uint32_t arg0 = 0; byte_t buf[USB_CMD_DATA_SIZE]; uint8_t par[MAX_PARITY_SIZE]; @@ -1916,7 +1917,7 @@ void ReaderIso14443a(UsbCommand *c) } if(param & ISO14A_SET_TIMEOUT) { - iso14a_set_timeout(c->arg[2]); + iso14a_set_timeout(timeout); } if(param & ISO14A_APDU) { diff --git a/armsrc/lfops.c b/armsrc/lfops.c index 468f5830..16c42855 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -16,6 +16,7 @@ #include "string.h" #include "lfdemod.h" #include "lfsampling.h" +#include "usb_cdc.h" /** @@ -401,7 +402,7 @@ void SimulateTagLowFrequency(int period, int gap, int ledcontrol) for(;;) { //wait until SSC_CLK goes HIGH while(!(AT91C_BASE_PIOA->PIO_PDSR & GPIO_SSC_CLK)) { - if(BUTTON_PRESS()) { + if(BUTTON_PRESS() || usb_poll()) { DbpString("Stopped"); return; } diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 744b3875..d36ebb8b 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -560,7 +560,7 @@ int CmdHF14ACmdRaw(const char *cmd) { timeout = temp; i+=3; while(cmd[i]!=' ' && cmd[i]!='\0') { i++; } - i+=2; + i-=2; break; default: PrintAndLog("Invalid option"); @@ -605,6 +605,7 @@ int CmdHF14ACmdRaw(const char *cmd) { if(active) c.arg[0] |= ISO14A_NO_SELECT; } + if(bTimeout){ #define MAX_TIMEOUT 40542464 // (2^32-1) * (8*16) / 13560000Hz * 1000ms/s = c.arg[0] |= ISO14A_SET_TIMEOUT; @@ -612,7 +613,7 @@ int CmdHF14ACmdRaw(const char *cmd) { timeout = MAX_TIMEOUT; PrintAndLog("Set timeout to 40542 seconds (11.26 hours). The max we can wait for response"); } - c.arg[2] = 13560000 / 1000 / (8*16) * timeout; // timeout in ETUs (time to transfer 1 bit, approx. 9.4 us) + c.arg[2] = 13560000 / 1000 / (8*16) * timeout; // timeout in ETUs (time to transfer 1 bit, approx. 9.4 us) } if(power) c.arg[0] |= ISO14A_NO_DISCONNECT;