From 40ccdb0e735a15deac9287320c92ca05c9faf35c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 10 Mar 2019 14:39:46 +0100 Subject: [PATCH] clean up --- armsrc/hitag2.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index d408c0ab3..be82e63dd 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1227,16 +1227,13 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { bool bStop = false; bool bQuitTraceFull = false; - FpgaDownloadAndGo(FPGA_BITSTREAM_LF); - // Reset the return status bSuccessful = false; - // Clean up trace and prepare it for storing frames + FpgaDownloadAndGo(FPGA_BITSTREAM_LF); + clear_trace(); set_tracing(true); - //DbpString("Starting Hitag reader family"); - // Check configuration switch (htf) { case RHT2F_PASSWORD: { @@ -1360,8 +1357,9 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { return; } uint8_t attempt_count = 0; - while (!bStop && !BUTTON_PRESS()) { - // Watchdog hit + + while (!bStop && !BUTTON_PRESS() && !usb_poll_validate_length() ) { + WDT_HIT(); // Check if frame was captured and store it @@ -1499,7 +1497,6 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { rxlen++; } } else { - //Dbprintf("DEBUG: Wierd2"); errorCount++; // Ignore wierd value, is to small to mean anything }