mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-01 21:22:19 +08: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.
|
||||
// set transfer address and number of bytes. Start transfer.
|
||||
if ( !FpgaSetupSscDma((uint8_t*) dmaBuf, DMA_BUFFER_SIZE) ){
|
||||
if (MF_DBGLEVEL > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
|
||||
if ( !FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) ){
|
||||
if (MF_DBGLEVEL > 1) Dbprintf("[-] FpgaSetupSscDma failed. Exiting");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3427,6 +3427,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
|||
LED_A_ON();
|
||||
|
||||
if ((sniffCounter & 0x0000FFFF) == 0) { // from time to time
|
||||
|
||||
// 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 (MfSniffSend(2000)) {
|
||||
|
@ -3438,7 +3439,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
|||
TagIsActive = false;
|
||||
// Setup and start DMA. set transfer address and number of bytes. Start transfer.
|
||||
if ( !FpgaSetupSscDma(dmaBuf, DMA_BUFFER_SIZE) ){
|
||||
if (MF_DBGLEVEL > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
|
||||
if (MF_DBGLEVEL > 1) DbpString("[-] FpgaSetupSscDma failed. Exiting");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -3458,7 +3459,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
|||
if (dataLen > maxDataLen) { // we are more behind than ever...
|
||||
maxDataLen = dataLen;
|
||||
if (dataLen > (9 * DMA_BUFFER_SIZE / 10)) {
|
||||
Dbprintf("blew circular buffer! dataLen=0x%x", dataLen);
|
||||
Dbprintf("[-] blew circular buffer! dataLen=0x%x", dataLen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3468,7 +3469,7 @@ void RAMFUNC SniffMifare(uint8_t param) {
|
|||
if (!AT91C_BASE_PDC_SSC->PDC_RCR) {
|
||||
AT91C_BASE_PDC_SSC->PDC_RPR = (uint32_t)dmaBuf;
|
||||
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
|
||||
if (!AT91C_BASE_PDC_SSC->PDC_RNCR) {
|
||||
|
|
Loading…
Reference in a new issue