mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
fix ht2 initial command timing
This commit is contained in:
parent
cf56fece21
commit
59976aa588
1 changed files with 11 additions and 5 deletions
|
@ -130,6 +130,8 @@ static int hitag2_init(void) {
|
||||||
#define HITAG_T_WAIT_2_MIN 90 /* T_wait2 should be at least 90 */
|
#define HITAG_T_WAIT_2_MIN 90 /* T_wait2 should be at least 90 */
|
||||||
#define HITAG_T_WAIT_MAX 300 /* bit more than HITAG_T_WAIT_1 + HITAG_T_WAIT_2 */
|
#define HITAG_T_WAIT_MAX 300 /* bit more than HITAG_T_WAIT_1 + HITAG_T_WAIT_2 */
|
||||||
#define HITAG_T_PROG 614
|
#define HITAG_T_PROG 614
|
||||||
|
#define HITAG_T_WAIT_POWERUP 313 /* transponder internal powerup time is 312.5 */
|
||||||
|
#define HITAG_T_WAIT_START_AUTH_MAX 232 /* transponder waiting time to receive the START_AUTH command is 232.5, then it enters public mode */
|
||||||
|
|
||||||
#define HITAG_T_TAG_ONE_HALF_PERIOD 10
|
#define HITAG_T_TAG_ONE_HALF_PERIOD 10
|
||||||
#define HITAG_T_TAG_TWO_HALF_PERIOD 25
|
#define HITAG_T_TAG_TWO_HALF_PERIOD 25
|
||||||
|
@ -1501,14 +1503,18 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (turn_on) {
|
if (turn_on) {
|
||||||
|
// Wait 50ms with field off to be sure the transponder gets reset
|
||||||
|
SpinDelay(50);
|
||||||
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_ADC | FPGA_LF_ADC_READER_FIELD);
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_ADC | FPGA_LF_ADC_READER_FIELD);
|
||||||
turn_on = false;
|
turn_on = false;
|
||||||
}
|
// Wait with field on to be in "Wait for START_AUTH" timeframe
|
||||||
|
lf_wait_periods(HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4);
|
||||||
|
command_start += HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4;
|
||||||
|
} else {
|
||||||
// Wait for t_wait_2 carrier periods after the last tag bit before transmitting,
|
// Wait for t_wait_2 carrier periods after the last tag bit before transmitting,
|
||||||
lf_wait_periods(t_wait_2);
|
lf_wait_periods(t_wait_2);
|
||||||
command_start += t_wait_2;
|
command_start += t_wait_2;
|
||||||
|
}
|
||||||
// Transmit the reader frame
|
// Transmit the reader frame
|
||||||
command_duration = hitag_reader_send_frame(tx, txlen);
|
command_duration = hitag_reader_send_frame(tx, txlen);
|
||||||
response_start = command_start + command_duration;
|
response_start = command_start + command_duration;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue