]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - common/lfdemod.c
Merge branch 'master' of https://github.com/Proxmark/proxmark3
[proxmark3-svn] / common / lfdemod.c
index 46ac4924247885f9a4028d76f1e379ebf2f57f25..12f380d586f15225f1f2d4efdbb3834b170af2db 100644 (file)
@@ -1666,22 +1666,22 @@ int pskRawDemod(uint8_t dest[], size_t *size, int *clock, int *invert)
   //find first phase shift
   for (i=0; i<loopCnt; i++){
     if (dest[i]+fc < dest[i+1] && dest[i+1] >= dest[i+2]){
-      waveEnd = i+1;
-      //PrintAndLog("DEBUG: waveEnd: %d",waveEnd);
-      waveLenCnt = waveEnd-waveStart;
+        waveEnd = i+1;
+        //PrintAndLog("DEBUG: waveEnd: %d",waveEnd);
+        waveLenCnt = waveEnd-waveStart;
       if (waveLenCnt > fc && waveStart > fc){ //not first peak and is a large wave 
         lastAvgWaveVal = avgWaveVal/(waveLenCnt);
-        firstFullWave = waveStart;
-        fullWaveLen=waveLenCnt;
-        //if average wave value is > graph 0 then it is an up wave or a 1
+          firstFullWave = waveStart;
+          fullWaveLen=waveLenCnt;
+          //if average wave value is > graph 0 then it is an up wave or a 1
         if (lastAvgWaveVal > 123) curPhase^=1;  //fudge graph 0 a little 123 vs 128
-        break;
-      } 
+          break;
+        
       waveStart = i+1;
       avgWaveVal = 0;
-    }
+      }
     avgWaveVal+=dest[i+2];
-  }
+    }
   //PrintAndLog("DEBUG: firstFullWave: %d, waveLen: %d",firstFullWave,fullWaveLen);  
   lastClkBit = firstFullWave; //set start of wave as clock align
   //PrintAndLog("DEBUG: clk: %d, lastClkBit: %d", *clock, lastClkBit);
@@ -1703,7 +1703,7 @@ int pskRawDemod(uint8_t dest[], size_t *size, int *clock, int *invert)
         waveEnd = i+1;
         waveLenCnt = waveEnd-waveStart;
         lastAvgWaveVal = avgWaveVal/waveLenCnt;
-        if (waveLenCnt > fc){  
+        if (waveLenCnt > fc){ 
           //PrintAndLog("DEBUG: avgWaveVal: %d, waveSum: %d",lastAvgWaveVal,avgWaveVal);
           //if this wave is a phase shift
           //PrintAndLog("DEBUG: phase shift at: %d, len: %d, nextClk: %d, i: %d, fc: %d",waveStart,waveLenCnt,lastClkBit+*clock-tol,i+1,fc);
Impressum, Datenschutz