mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
FIX: Possible usage of NULL.
This commit is contained in:
parent
65c2d21d05
commit
5f5254d631
1 changed files with 22 additions and 24 deletions
|
@ -1383,33 +1383,31 @@ static int SendIClassAnswer(uint8_t *resp, int respLen, int delay)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
static void TransmitIClassCommand(const uint8_t *cmd, int len, int *samples, int *wait)
|
static void TransmitIClassCommand(const uint8_t *cmd, int len, int *samples, int *wait)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_READER_MOD);
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_READER_MOD);
|
||||||
AT91C_BASE_SSC->SSC_THR = 0x00;
|
AT91C_BASE_SSC->SSC_THR = 0x00;
|
||||||
FpgaSetupSsc();
|
FpgaSetupSsc();
|
||||||
|
|
||||||
if (wait)
|
if (wait) {
|
||||||
{
|
if(*wait < 10) *wait = 10;
|
||||||
if(*wait < 10) *wait = 10;
|
|
||||||
|
|
||||||
for(c = 0; c < *wait;) {
|
for(c = 0; c < *wait;) {
|
||||||
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
||||||
AT91C_BASE_SSC->SSC_THR = 0x00; // For exact timing!
|
AT91C_BASE_SSC->SSC_THR = 0x00; // For exact timing!
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_RXRDY)) {
|
||||||
volatile uint32_t r = AT91C_BASE_SSC->SSC_RHR;
|
volatile uint32_t r = AT91C_BASE_SSC->SSC_RHR;
|
||||||
(void)r;
|
(void)r;
|
||||||
}
|
}
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint8_t sendbyte;
|
uint8_t sendbyte;
|
||||||
bool firstpart = TRUE;
|
bool firstpart = TRUE;
|
||||||
c = 0;
|
c = 0;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
if(AT91C_BASE_SSC->SSC_SR & (AT91C_SSC_TXRDY)) {
|
||||||
|
|
||||||
|
@ -1437,7 +1435,7 @@ static void TransmitIClassCommand(const uint8_t *cmd, int len, int *samples, int
|
||||||
}
|
}
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
}
|
}
|
||||||
if (samples) *samples = (c + *wait) << 3;
|
if (samples && wait) *samples = (c + *wait) << 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue