mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Merge pull request #263 from merlokk/apdu_armside
added 14a send/receive arm timeout
This commit is contained in:
commit
e23ea71427
1 changed files with 16 additions and 0 deletions
|
@ -1583,10 +1583,20 @@ static void TransmitFor14443a(const uint8_t *cmd, uint16_t len, uint32_t *timing
|
||||||
|
|
||||||
volatile uint8_t b;
|
volatile uint8_t b;
|
||||||
uint16_t c = 0;
|
uint16_t c = 0;
|
||||||
|
uint32_t sendtimer = GetTickCount();
|
||||||
|
uint32_t cntr = 0;
|
||||||
while (c < len) {
|
while (c < len) {
|
||||||
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
||||||
AT91C_BASE_SSC->SSC_THR = cmd[c++];
|
AT91C_BASE_SSC->SSC_THR = cmd[c++];
|
||||||
|
cntr = 0;
|
||||||
|
} else {
|
||||||
|
if (cntr++ > 1000) {
|
||||||
|
cntr = 0;
|
||||||
|
if (GetTickCount() - sendtimer > 100)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//iceman test
|
//iceman test
|
||||||
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
if (AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
||||||
b = (uint16_t)(AT91C_BASE_SSC->SSC_RHR);
|
b = (uint16_t)(AT91C_BASE_SSC->SSC_RHR);
|
||||||
|
@ -1945,6 +1955,7 @@ static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, uint8_t *receive
|
||||||
(void)b;
|
(void)b;
|
||||||
|
|
||||||
uint32_t timeout = iso14a_get_timeout();
|
uint32_t timeout = iso14a_get_timeout();
|
||||||
|
uint32_t receive_timer = GetTickCount();
|
||||||
for (;;) {
|
for (;;) {
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
|
@ -1957,7 +1968,12 @@ static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, uint8_t *receive
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// timeout already in ms + 100ms guard time
|
||||||
|
if (GetTickCount() - receive_timer > timeout + 100)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing) {
|
void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue