X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/1b902aa01afa39ff413b74142cd56d092b4500a1..351d6d17b3fa82a82b2205c69dcc024884d0b146:/armsrc/legicrfsim.c?ds=sidebyside diff --git a/armsrc/legicrfsim.c b/armsrc/legicrfsim.c index 07a0a62d..a149e0f9 100644 --- a/armsrc/legicrfsim.c +++ b/armsrc/legicrfsim.c @@ -19,6 +19,7 @@ #include "legic_prng.h" #include "legic.h" #include "crc.h" +#include "usb_cdc.h" // for usb_poll_validate_length static uint8_t* legic_mem; /* card memory, used for sim */ static legic_card_select_t card;/* metadata of currently selected card */ @@ -283,7 +284,7 @@ static void init_tag() { SetAdcMuxFor(GPIO_MUXSEL_HIPKD); // configure SSC with defaults - FpgaSetupSsc(); + FpgaSetupSsc(FPGA_MAJOR_MODE_HF_SIMULATOR); // first pull output to low to prevent glitches then re-claim GPIO_SSC_DOUT LOW(GPIO_SSC_DOUT); @@ -439,7 +440,7 @@ void LegicRfSimulate(uint8_t cardtype) { LED_A_ON(); DbpString("Starting Legic emulator, press button to end"); - while(!BUTTON_PRESS()) { + while(!BUTTON_PRESS() && !usb_poll_validate_length()) { WDT_HIT(); // wait for carrier, restart after timeout