From: iceman1001 Date: Mon, 20 Jun 2016 11:26:45 +0000 (+0200) Subject: @marshmellow42 's fix the AskEdgeDetect cleaning tool. https://github.com/marshmellow... X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/180ec86ef0c5a005b7a677b6da3d98b8b127782f @marshmellow42 's fix the AskEdgeDetect cleaning tool. https://github.com/marshmellow42/proxmark3/commit/de53156e1ea6982f03a6c39adf1ae17a57056132 --- diff --git a/client/cmddata.c b/client/cmddata.c index d0c2dfb3..40884a14 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -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=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;