]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - common/lfdemod.c
FIX: @marshmellow42 's ST detection fix.
[proxmark3-svn] / common / lfdemod.c
index 7f8333ac1185420dc039ebfb334e6b404ac5e36d..c177468f0c312b7e59ed4d4ca05b5fca75a9ad5e 100644 (file)
@@ -1845,6 +1845,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