]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Fix the AskEdgeDetect cleaning tool
authormarshmellow42 <marshmellowrf@gmail.com>
Mon, 20 Jun 2016 03:44:54 +0000 (23:44 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Mon, 20 Jun 2016 03:44:54 +0000 (23:44 -0400)
somehow it got broken.
(maybe i had an incomplete pull request once upon a time)

client/cmddata.c

index 9854ccfa89807744db2cb7fa74895bd0361ff38f..ba161dd832fbbdd371f52b1395acb3b83923e640 100644 (file)
@@ -879,13 +879,15 @@ int CmdGraphShiftZero(const char *Cmd)
 int CmdAskEdgeDetect(const char *Cmd)
 {
        int thresLen = 25;
 int CmdAskEdgeDetect(const char *Cmd)
 {
        int thresLen = 25;
+       int Last = 0;
        sscanf(Cmd, "%i", &thresLen); 
 
        for(int i = 1; i<GraphTraceLen; i++){
                if (GraphBuffer[i]-GraphBuffer[i-1]>=thresLen) //large jump up
        sscanf(Cmd, "%i", &thresLen); 
 
        for(int i = 1; i<GraphTraceLen; i++){
                if (GraphBuffer[i]-GraphBuffer[i-1]>=thresLen) //large jump up
-                       GraphBuffer[i-1] = 127;
+                       Last = 127;
                else if(GraphBuffer[i]-GraphBuffer[i-1]<=-1*thresLen) //large jump down
                else if(GraphBuffer[i]-GraphBuffer[i-1]<=-1*thresLen) //large jump down
-                       GraphBuffer[i-1] = -127;
+                       Last = -127;
+               GraphBuffer[i-1] = Last;
        }
        RepaintGraphWindow();
        return 0;
        }
        RepaintGraphWindow();
        return 0;
Impressum, Datenschutz