mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
syntax sugar
This commit is contained in:
parent
82dbfba827
commit
05b62d0b3d
1 changed files with 14 additions and 13 deletions
|
@ -3410,8 +3410,8 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
|
|
||||||
// Setup and start DMA.
|
// Setup and start DMA.
|
||||||
// set transfer address and number of bytes. Start transfer.
|
// set transfer address and number of bytes. Start transfer.
|
||||||
if ( !FpgaSetupSscDma((uint8_t*) dmaBuf, DMA_BUFFER_SIZE) ){
|
if ( !FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) ){
|
||||||
if (MF_DBGLEVEL > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
|
if (MF_DBGLEVEL > 1) Dbprintf("[-] FpgaSetupSscDma failed. Exiting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3427,6 +3427,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
LED_A_ON();
|
LED_A_ON();
|
||||||
|
|
||||||
if ((sniffCounter & 0x0000FFFF) == 0) { // from time to time
|
if ((sniffCounter & 0x0000FFFF) == 0) { // from time to time
|
||||||
|
|
||||||
// check if a transaction is completed (timeout after 2000ms).
|
// check if a transaction is completed (timeout after 2000ms).
|
||||||
// if yes, stop the DMA transfer and send what we have so far to the client
|
// if yes, stop the DMA transfer and send what we have so far to the client
|
||||||
if (MfSniffSend(2000)) {
|
if (MfSniffSend(2000)) {
|
||||||
|
@ -3438,7 +3439,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
TagIsActive = false;
|
TagIsActive = false;
|
||||||
// Setup and start DMA. set transfer address and number of bytes. Start transfer.
|
// Setup and start DMA. set transfer address and number of bytes. Start transfer.
|
||||||
if ( !FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) ){
|
if ( !FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) ){
|
||||||
if (MF_DBGLEVEL > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
|
if (MF_DBGLEVEL > 1) DbpString("[-] FpgaSetupSscDma failed. Exiting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3458,7 +3459,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
if (dataLen > maxDataLen) { // we are more behind than ever...
|
if (dataLen > maxDataLen) { // we are more behind than ever...
|
||||||
maxDataLen = dataLen;
|
maxDataLen = dataLen;
|
||||||
if (dataLen > (9 * DMA_BUFFER_SIZE / 10)) {
|
if (dataLen > (9 * DMA_BUFFER_SIZE / 10)) {
|
||||||
Dbprintf("blew circular buffer! dataLen=0x%x", dataLen);
|
Dbprintf("[-] blew circular buffer! dataLen=0x%x", dataLen);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3468,7 +3469,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
||||||
if (!AT91C_BASE_PDC_SSC->PDC_RCR) {
|
if (!AT91C_BASE_PDC_SSC->PDC_RCR) {
|
||||||
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t)dmaBuf;
|
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t)dmaBuf;
|
||||||
AT91C_BASE_PDC_SSC->PDC_RCR = DMA_BUFFER_SIZE;
|
AT91C_BASE_PDC_SSC->PDC_RCR = DMA_BUFFER_SIZE;
|
||||||
Dbprintf("RxEmpty ERROR, data length:%d", dataLen); // temporary
|
Dbprintf("[-] RxEmpty ERROR, data length:%d", dataLen); // temporary
|
||||||
}
|
}
|
||||||
// secondary buffer sets as primary, secondary buffer was stopped
|
// secondary buffer sets as primary, secondary buffer was stopped
|
||||||
if (!AT91C_BASE_PDC_SSC->PDC_RNCR) {
|
if (!AT91C_BASE_PDC_SSC->PDC_RNCR) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue