This commit is contained in:
iceman1001 2024-02-20 11:14:17 +01:00
commit 2ed69ad8f7

View file

@ -1734,11 +1734,13 @@ void ReaderHitag(hitag_function htf, const hitag_data *htd, bool ledcontrol) {
} }
case RHT2F_UID_ONLY: { case RHT2F_UID_ONLY: {
bStop = !hitag2_read_uid(rx, rxlen, tx, &txlen); bStop = !hitag2_read_uid(rx, rxlen, tx, &txlen);
if (bSuccessful) bStop = true; if (bSuccessful) {
attempt_count++; //attempt 3 times to get uid then quit
if (!bStop && attempt_count == 3)
bStop = true; bStop = true;
}
attempt_count++; //attempt 3 times to get uid then quit
if ((bStop == false) && (attempt_count == 3)) {
bStop = true;
}
break; break;
} }
default: { default: {
@ -1746,7 +1748,10 @@ void ReaderHitag(hitag_function htf, const hitag_data *htd, bool ledcontrol) {
goto out; goto out;
} }
} }
if (bStop) break; if (bStop) {
break;
}
if (turn_on) { if (turn_on) {
// Wait 50ms with field off to be sure the transponder gets reset // Wait 50ms with field off to be sure the transponder gets reset
SpinDelay(50); SpinDelay(50);
@ -1779,6 +1784,7 @@ void ReaderHitag(hitag_function htf, const hitag_data *htd, bool ledcontrol) {
tag_modulation = lf_get_tag_modulation(); tag_modulation = lf_get_tag_modulation();
// Reset the number of NRZ samples and use edge detection to detect them // Reset the number of NRZ samples and use edge detection to detect them
nrzs = 0; nrzs = 0;
while (nrzs < max_nrzs) { while (nrzs < max_nrzs) {
// Get the timing of the next edge in number of wave periods // Get the timing of the next edge in number of wave periods