]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/lfsampling.c
Merge pull request #208 from marshmellow42/master
[proxmark3-svn] / armsrc / lfsampling.c
index b6ca920907e220d5ad9a69898f2530fe2970da7c..88df543f74022e4657b871e061c662c61c8a610d 100644 (file)
@@ -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 && i<bufsize ) {
                WDT_HIT();
                if (AT91C_BASE_SSC->SSC_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;
                        }
                }
        }
Impressum, Datenschutz