X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/355c8b4a7df083c13d82963fb9d14548647e91b1..9e8255d4e99eb2917df13be92402e75a73417696:/armsrc/iso14443.c diff --git a/armsrc/iso14443.c b/armsrc/iso14443.c index 4d7d4fa8..3c8e1fdd 100644 --- a/armsrc/iso14443.c +++ b/armsrc/iso14443.c @@ -628,30 +628,26 @@ static void GetSamplesFor14443Demod(int weTx, int n, int quiet) int max = 0; int gotFrame = FALSE; -//# define DMA_BUFFER_SIZE 8 - int8_t *dmaBuf; - int lastRxCounter; - int8_t *upTo; int ci, cq; int samples = 0; // Clear out the state of the "UART" that receives from the tag. - memset(BigBuf, 0x00, 400); - Demod.output = (uint8_t *)BigBuf; + memset(Demod.output, 0x00, MAX_FRAME_SIZE); + Demod.output = ((uint8_t *)BigBuf) + RECV_RESP_OFFSET; Demod.len = 0; Demod.state = DEMOD_UNSYNCD; // And the UART that receives from the reader - Uart.output = (((uint8_t *)BigBuf) + 1024); - Uart.byteCntMax = 100; + Uart.output = ((uint8_t *)BigBuf) + RECV_CMD_OFFSET; + Uart.byteCntMax = MAX_FRAME_SIZE; Uart.state = STATE_UNSYNCD; - // Setup for the DMA. - dmaBuf = (int8_t *)(BigBuf + 32); - upTo = dmaBuf; + // The DMA buffer, used to stream samples from the FPGA + int8_t *dmaBuf = ((int8_t *)BigBuf) + DMA_BUFFER_OFFSET; + int8_t *upTo= dmaBuf; lastRxCounter = DEMOD_DMA_BUFFER_SIZE; FpgaSetupSscDma((uint8_t *)dmaBuf, DEMOD_DMA_BUFFER_SIZE);