X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/6fe5c94bda4d272dc739b71ed5e54a8678f6065a..94e27a096143b68c4ec00b8cb2216f00811f48ab:/armsrc/lfsampling.c diff --git a/armsrc/lfsampling.c b/armsrc/lfsampling.c index b6ca9209..88df543f 100644 --- a/armsrc/lfsampling.c +++ b/armsrc/lfsampling.c @@ -10,7 +10,7 @@ #include "apps.h" #include "util.h" #include "string.h" - +#include "usb_cdc.h" // for usb_poll_validate_length #include "lfsampling.h" sample_config config = { 1, 8, 1, 95, 0 } ; @@ -124,7 +124,7 @@ uint32_t DoAcquisition(uint8_t decimation, uint32_t bits_per_sample, bool averag uint8_t *dest = BigBuf_get_addr(); int bufsize = BigBuf_max_traceLen(); - memset(dest, 0, bufsize); + //memset(dest, 0, bufsize); //creates issues with cmdread (marshmellow) if(bits_per_sample < 1) bits_per_sample = 1; if(bits_per_sample > 8) bits_per_sample = 8; @@ -272,7 +272,7 @@ void doT55x7Acquisition(size_t sample_size) { uint8_t curSample = 0; uint8_t lastSample = 0; uint16_t skipCnt = 0; - while(!BUTTON_PRESS() && skipCnt<1000) { + while(!BUTTON_PRESS() && !usb_poll_validate_length() && skipCnt<1000 && iSSC_SR & AT91C_SSC_TXRDY) { AT91C_BASE_SSC->SSC_THR = 0x43; @@ -311,7 +311,6 @@ void doT55x7Acquisition(size_t sample_size) { } // collect samples dest[i++] = curSample; - if (i >= bufsize-1) break; } } }