mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 21:03:48 -07:00
CHG: FpgaSetupDMA can fail and returns NULL. Added a check for it.
This commit is contained in:
parent
fd3be901ea
commit
a287e8cfdd
1 changed files with 12 additions and 2 deletions
|
@ -677,7 +677,11 @@ void RAMFUNC SnoopIClass(void)
|
||||||
FpgaSetupSsc();
|
FpgaSetupSsc();
|
||||||
upTo = dmaBuf;
|
upTo = dmaBuf;
|
||||||
lastRxCounter = DMA_BUFFER_SIZE;
|
lastRxCounter = DMA_BUFFER_SIZE;
|
||||||
FpgaSetupSscDma((uint8_t *)dmaBuf, DMA_BUFFER_SIZE);
|
// Setup and start DMA.
|
||||||
|
if ( !FpgaSetupSscDma((uint8_t*) dmaBuf, DMA_BUFFER_SIZE) ){
|
||||||
|
if (MF_DBGLEVEL > 1) Dbprintf("FpgaSetupSscDma failed. Exiting");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// And the reader -> tag commands
|
// And the reader -> tag commands
|
||||||
memset(&Uart, 0, sizeof(Uart));
|
memset(&Uart, 0, sizeof(Uart));
|
||||||
|
@ -1539,9 +1543,15 @@ static int GetIClassAnswer(uint8_t *receivedResponse, int maxLen, int *samples,
|
||||||
if (elapsed) (*elapsed)++;
|
if (elapsed) (*elapsed)++;
|
||||||
}
|
}
|
||||||
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
||||||
if(c < timeout) { c++; } else { return FALSE; }
|
if(c < timeout)
|
||||||
|
c++;
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
b = (uint8_t)AT91C_BASE_SSC->SSC_RHR;
|
||||||
|
|
||||||
skip = !skip;
|
skip = !skip;
|
||||||
|
|
||||||
if(skip) continue;
|
if(skip) continue;
|
||||||
|
|
||||||
if(ManchesterDecoding(b & 0x0f)) {
|
if(ManchesterDecoding(b & 0x0f)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue