X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/614da335f6e2c35ea8620cecacdde8270111e5b1..0db11b71efad3781186cc2da9f31686a6562d065:/armsrc/lfops.c diff --git a/armsrc/lfops.c b/armsrc/lfops.c index 2f757f1f..54800f49 100644 --- a/armsrc/lfops.c +++ b/armsrc/lfops.c @@ -17,7 +17,7 @@ #include "lfdemod.h" #include "lfsampling.h" #include "protocols.h" -#include "usb_cdc.h" //test +#include "usb_cdc.h" // for usb_poll_validate_length /** * Function to do a modulation and then get samples. @@ -37,6 +37,8 @@ void ModThenAcquireRawAdcSamples125k(uint32_t delay_off, uint32_t period_0, uint sample_config sc = { 0,0,1, divisor_used, 0}; setSamplingConfig(&sc); + //clear read buffer + BigBuf_Clear_keep_EM(); /* Make sure the tag is reset */ FpgaDownloadAndGo(FPGA_BITSTREAM_LF); @@ -626,7 +628,7 @@ static void biphaseSimBit(uint8_t c, int *n, uint8_t clock, uint8_t *phase) memset(dest+(*n), c ^ *phase, clock); *phase ^= 1; } - + *n += clock; } // args clock, ask/man or askraw, invert, transmission separator @@ -644,7 +646,7 @@ void CmdASKsimTag(uint16_t arg1, uint16_t arg2, size_t size, uint8_t *BitStream) for (i=0; i startblock; i--) @@ -1602,7 +1614,7 @@ void EM4xReadWord(uint8_t Address, uint32_t Pwd, uint8_t PwdMode) { uint16_t bufsize = BigBuf_max_traceLen(); uint32_t i = 0; - //clear buffer now so it does not interfere with timing later + // Clear destination buffer before sending the command BigBuf_Clear_ext(false); //If password mode do login