mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
now code can't use uninitialized fpga link and encoders/decoders
This commit is contained in:
parent
9dc1b1664d
commit
1e0433c1d7
1 changed files with 18 additions and 3 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#define MAX_ISO14A_TIMEOUT 524288
|
||||
static uint32_t iso14a_timeout;
|
||||
static bool iso14443a_active = false;
|
||||
|
||||
uint8_t colpos = 0;
|
||||
int rsamples = 0;
|
||||
|
@ -1551,6 +1552,9 @@ void PrepareDelayedTransfer(uint16_t delay) {
|
|||
//-------------------------------------------------------------------------------------
|
||||
static void TransmitFor14443a(const uint8_t *cmd, uint16_t len, uint32_t *timing) {
|
||||
|
||||
if (!iso14443a_active)
|
||||
return;
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_HF_ISO14443A | FPGA_HF_ISO14443A_READER_MOD);
|
||||
|
||||
if (timing) {
|
||||
|
@ -1922,6 +1926,9 @@ bool EmLogTrace(uint8_t *reader_data, uint16_t reader_len, uint32_t reader_Start
|
|||
//-----------------------------------------------------------------------------
|
||||
static int GetIso14443aAnswerFromTag(uint8_t *receivedResponse, uint8_t *receivedResponsePar, uint16_t offset) {
|
||||
uint32_t c = 0;
|
||||
|
||||
if (!iso14443a_active)
|
||||
return false;
|
||||
|
||||
// Set FPGA mode to "reader listen mode", no modulation (listen
|
||||
// only, since we are receiving, not transmitting).
|
||||
|
@ -2354,6 +2361,14 @@ void iso14443a_setup(uint8_t fpga_minor_mode) {
|
|||
UartReset();
|
||||
NextTransferTime = 2 * DELAY_ARM2AIR_AS_READER;
|
||||
iso14a_set_timeout(1060); // 106 * 10ms default
|
||||
|
||||
iso14443a_active = true;
|
||||
}
|
||||
|
||||
void iso14443a_off() {
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
LED_D_OFF();
|
||||
iso14443a_active = false;
|
||||
}
|
||||
|
||||
/* Peter Fillmore 2015
|
||||
|
@ -2558,7 +2573,7 @@ void ReaderIso14443a(PacketCommandNG *c) {
|
|||
return;
|
||||
|
||||
OUT:
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
iso14443a_off();
|
||||
set_tracing(false);
|
||||
LEDsoff();
|
||||
}
|
||||
|
@ -2854,7 +2869,7 @@ void ReaderMifare(bool first_try, uint8_t block, uint8_t keytype) {
|
|||
|
||||
reply_mix(CMD_ACK, isOK, 0, 0, buf, sizeof(buf));
|
||||
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
iso14443a_off();
|
||||
LEDsoff();
|
||||
set_tracing(false);
|
||||
}
|
||||
|
@ -3094,7 +3109,7 @@ void DetectNACKbug() {
|
|||
|
||||
//reply_mix(CMD_ACK, isOK, num_nacks, i, 0, 0);
|
||||
BigBuf_free();
|
||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||
iso14443a_off();
|
||||
LEDsoff();
|
||||
set_tracing(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue