]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
fix STT bug for strong waves (or cleaned ones)
authormarshmellow42 <marshmellowrf@gmail.com>
Tue, 28 Feb 2017 16:53:55 +0000 (11:53 -0500)
committermarshmellow42 <marshmellowrf@gmail.com>
Tue, 28 Feb 2017 16:53:55 +0000 (11:53 -0500)
common/lfdemod.c

index f5fee22a853328230020db91257c465575ec4d97..125112088e09fc57b44768e0743bcb2b67a0c356 100644 (file)
@@ -1759,6 +1759,10 @@ bool DetectST(uint8_t buffer[], size_t *size, int *foundclock) {
                        for(i=0; i < clk/2-tol; ++i) {
                                buffer[dataloc+i] = high+5;
                        }
+               } //test for single sample outlier (high between two lows) in the case of very strong waves
+               if (buffer[dataloc] >= high && buffer[dataloc+2] <= low) {
+                       buffer[dataloc] = buffer[dataloc+2];
+                       buffer[dataloc+1] = buffer[dataloc+2];
                }
                for (i=0; i<datalen; ++i) {
                        if (i+newloc < bufsize) {
Impressum, Datenschutz