]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
@marshmellow42 's fix the AskEdgeDetect cleaning tool. https://github.com/marshmellow...
authoriceman1001 <iceman@iuse.se>
Mon, 20 Jun 2016 11:26:45 +0000 (13:26 +0200)
committericeman1001 <iceman@iuse.se>
Mon, 20 Jun 2016 11:26:45 +0000 (13:26 +0200)
client/cmddata.c

index d0c2dfb34bfde114f80c0a6ca12a3fc47f7a0f7b..40884a14486de9aac94779ae19462df97ee6080a 100644 (file)
@@ -877,13 +877,16 @@ int CmdGraphShiftZero(const char *Cmd)
 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
-                       GraphBuffer[i-1] = 127;
-               else if(GraphBuffer[i]-GraphBuffer[i-1]<=-1*thresLen) //large jump down
-                       GraphBuffer[i-1] = -127;
+       for(int i = 1; i < GraphTraceLen; ++i){
+               if (GraphBuffer[i] - GraphBuffer[i-1] >= thresLen) //large jump up
+                       last = 127;
+               else if(GraphBuffer[i] - GraphBuffer[i-1] <= -1 * thresLen) //large jump down
+                       last = -127;
+                       
+               GraphBuffer[i-1] = last;
        }
        RepaintGraphWindow();
        return 0;
Impressum, Datenschutz