From: pwpiwi Date: Tue, 23 Dec 2014 10:44:41 +0000 (+0100) Subject: Merge branch 'master' of https://github.com/Proxmark/proxmark3 X-Git-Tag: v2.0.0-rc1~76 X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/4be9e7507b65e131a7c69a8cf67bda11978c47b3?hp=e68862947566842c673c005dc3f94aff9c830cfc Merge branch 'master' of https://github.com/Proxmark/proxmark3 --- diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index b1d3690f..a4632aa5 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -395,7 +395,11 @@ static RAMFUNC bool MillerDecoding(uint8_t bit, uint32_t non_real_time) } else if (Uart.len & 0x0007) { // there are some parity bits to store Uart.parityBits <<= (8 - (Uart.len&0x0007)); // left align remaining parity bits Uart.parity[Uart.parityLen++] = Uart.parityBits; // and store them + } + if (Uart.len) { return TRUE; // we are finished with decoding the raw data sequence + } else { + UartReset(); // Nothing received - try again } } if (Uart.state == STATE_START_OF_COMMUNICATION) { // error - must not follow directly after SOC @@ -558,6 +562,8 @@ static RAMFUNC int ManchesterDecoding(uint8_t bit, uint16_t offset, uint32_t non } else if (Demod.len & 0x0007) { // there are some parity bits to store Demod.parityBits <<= (8 - (Demod.len&0x0007)); // left align remaining parity bits Demod.parity[Demod.parityLen++] = Demod.parityBits; // and store them + } + if (Demod.len) { return TRUE; // we are finished with decoding the raw data sequence } else { // nothing received. Start over DemodReset(); @@ -1631,7 +1637,7 @@ bool EmLogTrace(uint8_t *reader_data, uint16_t reader_len, uint32_t reader_Start //----------------------------------------------------------------------------- static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, uint8_t *receivedResponsePar, uint16_t offset) { - uint16_t c; + uint32_t c; // Set FPGA mode to "reader listen mode", no modulation (listen // only, since we are receiving, not transmitting). diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 91741134..c9976076 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -191,6 +191,11 @@ int CmdHF14AReader(const char *Cmd) if(select_status == 0) { PrintAndLog("iso14443a card select failed"); + // disconnect + c.arg[0] = 0; + c.arg[1] = 0; + c.arg[2] = 0; + SendCommand(&c); return 0; }